Java Could not reserve enough space for object heap error
I have Java7 running on 32-bit Windows and 4 GB RAM, but:
java -Xmx4G -Xms4G -jar Minecraft.jar
java -Xmx3G -Xms3G -jar Minecraft.jar
java -Xmx2G -Xms2G -jar Minecraft.jar
...still does not work. Error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
java -Xmx1G -Xms1G -jar Minecraft.jar
is working. Why?
转到Start
→ Control Panel
→ System
→ Advanced system settings
→ advanced(tab)
→ Environment Variables
→ System Variables
→ New
:
Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M
If you go thru this IBM link on java, it says that on 32 bit windows the recommended heap size is 1.5 GB and the Maximum heap size is 1.8 GB. So your jvm does not gets initialized for -Xmx2G
and above.
Also if you go thru this SO answer, clearly the DLL bindings are an issue for memory reservation changing which is no trivial task. Hence what may be recommended is that you go for 64-bit Windows and a 64-bit JVM. while it will chew up more RAM, you will have much more contiguous virtual address space.
I had this problem. I solved it with downloading 64x of the Java. Here is the link: http://javadl.sun.com/webapps/download/AutoDL?BundleId=87443
链接地址: http://www.djcxy.com/p/14562.html上一篇: Android Gradle无法为对象堆预留足够的空间
下一篇: Java无法为对象堆错误预留足够的空间