Skip to content

Increase Java memory limit defined in loadeR.java #95

@jesusff

Description

@jesusff

@anacv wrote:
I have a question: Is there an easy way to increase the Java memory limit defined in loadeR.java (currently 2GB)?
After some research, I managed to do it by calling jinit between the require of rJava and loadeR, but I’m not sure if there is a more direct way within loadeR:

.jinit(classpath = "netcdfAll-4.6.0-SNAPSHOT.jar", parameters = options(java.parameters = "-Xmx6g"))

Thanks!

@jbedia wrote:
For a specific session, you can do it through R's global options:

options(java.parameters = "-Xmx8g")  # Allows up to 8GB of heap memory

The -Xms option would set a minimum allocation, though that’s usually not necessary.
If you request more memory than your system can provide, I believe Java will simply ignore it.

@anacv
Hi, thanks for the responses! I see that both options work.
Is this documented anywhere?

Now it is 🙂

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions