[R-SIG-Mac] Increase heap space of openNLP

Simon Urbanek simon.urbanek at r-project.org
Mon Oct 26 15:04:49 CET 2009


On Oct 26, 2009, at 9:44 , Richard R. Liu wrote:

> Many thanks for your reply.  I'm afraid I'm very new at all this.  I  
> really
> don't know where to set the Java parameter -Xmx.

If the packages you use don't override default settings you can simply  
set (example for 2GB):

options(java.parameters="-Xmx2g")

If they do, you can make 100% sure that they won't be able to by  
running the following before loading any packages:

library(rJava)
.jinit(parameters="-Xmx2g")

The above examples sets the heap to 2GB of memory -- but make sure you  
have that much memory otherwise Java won't accept it.

On the command line (Terminal) type "java -X" to see the Java  
parameters you can set.

Cheers,
Simon


>  In most applications that are written in Java for the Mac, there is  
> usually some way to set those parameters in the .plist of the app.   
> I don't find any such section for R.app or R64.app.  I have located  
> the openNLP package in ~/Libraries/R/Library/2.9, but I don't see  
> anything there.  I obviously looked in R-help for "increase heap  
> space", etc., before posing the question.
> Could you be a bit more specific about where to set this parameter?   
> Everything I do in R I do through the R GUI.
>
> Thanks,
> Richard
>
> On Mon, 26 Oct 2009 08:41:51 -0400, Simon Urbanek wrote
>> On Oct 26, 2009, at 6:58 AM, Richard R. Liu wrote:
>>
>>> I'm not sure whether this question belongs in this SIG or in the R-
>>> help mail list.
>>>
>>> I'm running R 2.9.2 "Leopard" version on a MacBook Pro 17" early
>>> 2009 laptop
>>> with OS X 10.5.8.  Due to memory problems I am running the 64-bit
>>> version of
>>> R.app, R64.  When I sentDetect I get a an out-of-memory Java heap
>>> space
>>> exception.  How can increase the heap space to avoid this error?
>>>
>>
>> set -Xmx Java parameter (see java -X)
>>
>> Cheers,
>> Simon
>
>
> --
> Richard R. Liu
> Dittingerstr. 33
> CH-4053 Basel
> Switzerland
>
> Tel.:  +41 61 331 10 47
> Email:  richard.liu at pueo-owl.ch
>
>



More information about the R-SIG-Mac mailing list