开发者

Can't start up: not enough memory with -Xmx30G

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 th开发者_开发技巧e 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


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)


You're probably running 32 bit java, see http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_heap_32bit


Make sure you're using the 64-bit JVM. I think the 32-bit memory limit is around 4GB of memory.


You need 64bit jvm to use more than 2/3Gb (depends on os version).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜