Willem Ligtenberg
2011-02-09 10:16:51 UTC
Hi,
While using the xlsx package to read xlsx files, I get an error that
it has run out of java heap space.
However, I can't seem to find a way to increase the heap size.
I have found that this should do the trick:
options( java.parameters = "-Xmx1200m" )
Xlsx still crashes and didn't seem to take more memory.
Therefore, I tried to see what the maximum available amount of heap
space is in an instance.
By:
.jinit()
.jcall(.jnew("java/lang/Runtime"), "J", "totalMemory")
.jcall(.jnew("java/lang/Runtime"), "J", "maxMemory")
returning:
16318464
and:
259522560
I have also tried the following:
.jinit(parameters="-Xmx1200m")
.jcall(.jnew("java/lang/Runtime"), "J", "totalMemory")
.jcall(.jnew("java/lang/Runtime"), "J", "maxMemory")
Same result.
And I have just found:
system("java -Xms512m -Xmx1536m")
.jinit()
.jcall(.jnew("java/lang/Runtime"), "J", "totalMemory")
.jcall(.jnew("java/lang/Runtime"), "J", "maxMemory")
And that also yields the same result.
Of course, I might be doing the measurement wrong, however I tested it
on another machine and it gave other results...
Could someone please help me with a good way to get at the available
heap space, and how to increase it for RJava?
Kind regards,
Willem
While using the xlsx package to read xlsx files, I get an error that
it has run out of java heap space.
However, I can't seem to find a way to increase the heap size.
I have found that this should do the trick:
options( java.parameters = "-Xmx1200m" )
Xlsx still crashes and didn't seem to take more memory.
Therefore, I tried to see what the maximum available amount of heap
space is in an instance.
By:
.jinit()
.jcall(.jnew("java/lang/Runtime"), "J", "totalMemory")
.jcall(.jnew("java/lang/Runtime"), "J", "maxMemory")
returning:
16318464
and:
259522560
I have also tried the following:
.jinit(parameters="-Xmx1200m")
.jcall(.jnew("java/lang/Runtime"), "J", "totalMemory")
.jcall(.jnew("java/lang/Runtime"), "J", "maxMemory")
Same result.
And I have just found:
system("java -Xms512m -Xmx1536m")
.jinit()
.jcall(.jnew("java/lang/Runtime"), "J", "totalMemory")
.jcall(.jnew("java/lang/Runtime"), "J", "maxMemory")
And that also yields the same result.
Of course, I might be doing the measurement wrong, however I tested it
on another machine and it gave other results...
Could someone please help me with a good way to get at the available
heap space, and how to increase it for RJava?
Kind regards,
Willem