简体   繁体   中英

JVM heap size not getting more than 1.6 GB for 64 bit JVM

I have a 64 bit machine with 8 GB RAM , windows 7. I am using 64 bit JVM. Still I am unable to set Max heap size more than 1600 M. I have read almost all the answers related to this topic on stackoverflow.

Whenever I try to set max heap as -Xmx2048M I am getting:

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

I have tried setting max heap size with _JAVA_OPTION system variable and also through:

Run -> Run Configuration -> Arguments path.

Both the times I am getting same error. RAM is almost free.

What is getting wrong?

Server JVM Default Initial and Maximum Heap Sizes

The default initial and maximum heap sizes work similarly on the server JVM as it does on the client JVM, except that the default values can go higher. On 32-bit JVMs, the default maximum heap size can be up to 1 GB if there is 4 GB or more of physical memory.

On 64-bit JVMs, the default maximum heap size can be up to 32 GB if there is 128 GB or more of physical memory.

You can always set a higher or lower initial and maximum heap by specifying those values directly; see the next section.

Oracle official documentation on Java 8 min/max heap

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