java 1.6 32-bit min and max heap memory issue

喜你入骨 提交于 2019-12-12 19:44:20

问题


I have the JRE v1.6 that is 32-bit installed. When I attempt to run a program as follows:

java -Xms1024m -Xmx2048m net.analysis.MyProg

I see the following message displayed:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine

As far as I know, the maximum heap allowed for a 32-bit JVM is 2 GB. On the computer running my code there is 131061 MB of physical memory (using Window's Task Manager, 128 GB of RAM).

Does anyone know what am I doing wrong here?


回答1:


In your case, the limit is most likely the 32 bit architecture and the way that Windows is apportioning the virtual address space.

According to the Oracle JVM FAQ, you can only expect to get 1.4Gb to 1.6Gb on a 32bit JVM on Windows.



来源:https://stackoverflow.com/questions/18307977/java-1-6-32-bit-min-and-max-heap-memory-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!