Reputation: 13081
I get the error message "Can't start up: not enough memory" when I run my code with "java -Xmx30G ExampleCode".
This error does not happen when I don't specify the java virtual machine size. Does anyone have a clue why I get that error message when I set the virtual machine size? If -Xmx is smaller than 1G then it runs, if not then I got the mentioned error message.
Thanks in advance for any help!
And yes, there is enough RAM :) (72G available).
BTW, JavaHome is /opt/jre1.6.0_20
Upvotes: 3
Views: 8922
Reputation: 6317
Make sure you're using the 64-bit JVM. I think the 32-bit memory limit is around 4GB of memory.
Upvotes: 1
Reputation: 27844
You're probably running 32 bit java, see http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_heap_32bit
Upvotes: 2
Reputation: 57192
The OS can impose a limit on how large a process can be. For example, in 32-bit windows, the limit is ~2GB, even if your machine has 4GB RAM. Check or OS settings, and be sure you are running a JVM where this would be allowed (i.e. if you're on a 64-bit system that supports this size process, be sure to run the 64-bit JVM)
Upvotes: 4