简体   繁体   中英

Java Could not reserve enough space for object heap

i have win7 32 bit java and 4 gb ram but still does java -Xmx4G -Xms4G -jar Minecraft.jar java -Xmx3G -Xms3G -jar Minecraft.jar java -Xmx2G -Xms2G -jar Minecraft.jar
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 work.

win7 32bit cannot use 4GB of memory for a user program .

The maximum any user program can use is '3GB' this includes code and data so -Xmx3G will cause it to fail everytime as you are giving 3GB to the heap which leaves zero space for all the other things the program will need let alone the JVM.

I question the value of setting mx.

The maximum size java can allocate for heap on Windows is about 1.5G because this OS tries to allocate a contiguous chunk of memory. If you need to run java with more heap size, you have to use Linux.

Read more: http://javarevisited.blogspot.com/2013/04/what-is-maximum-heap-size-for-32-bit-64-JVM-Java-memory

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM