Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 890
Kemal Tunca Avatar asked Aug 04 '13 06:08

Kemal Tunca


People also ask

How do I fix a heap space error?

How to fix it: The possible solution to such an error is increasing the heap by adding the -Xmx to your JVM application startup settings and setting it to a larger value than you are currently using.

What is the maximum heap size of 32-bit and 64 bit JVM?

Max Heap Size. The maximum theoretical heap limit for the 32-bit and 64-bit JVM is easy to determine by looking at the available memory space, 2^32 (4 GB) for 32-bit JVM and 2^64 (16 Exabytes) for 64-bit JVM. In practice, due to various constraints, the limit can be much lower and varies given the operating system.


1 Answers

Go to StartControl PanelSystemAdvanced system settingsadvanced(tab)Environment VariablesSystem VariablesNew:

Variable name: _JAVA_OPTIONS Variable value: -Xmx512M 
like image 175
user3755563 Avatar answered Sep 28 '22 00:09

user3755563