My Oracle Support Banner

How To Change the Default Maximum Java Heap For Java Commands On a Server With a Lot of RAM (Doc ID 1561023.1)

Last updated on OCTOBER 22, 2019

Applies to:

Java SE JDK and JRE - Version 1.5.0 and later
Information in this document applies to any platform.


In Java SE 5.0, a new performance feature for self tuning of the Java Virtual Machine (JVM) known as JVM Ergonomics was added. This is also present in Java SE 6 and Java SE 7. The idea is that when a Java process gets started, it can examine the underlying system resources and adjust itself for better performance.  You can do something similar with the setting of the various JVM flags.  One such flag controls the maximum heap size for the process.

The JVM ergonomics are subject to change.  They can even change between Java update releases.  For example starting with Java SE 6 update 18 (6u18), the default maximum heap size is half of the physical memory up to a physical memory size of 192 megabytes and otherwise one fourth of the physical memory up to a physical memory size of 4 gigabytes for the 32-bit JVMs and up to a physical memory size of 128 gigabytes for the 64-bit JVMs. See also the Java 6u18 Release Notes.

On well equipped servers with a lot of physical memory, even a very simple Java program could reserve gigabytes of memory for the Java heap by default due to the JVM ergonomics.

Therefore we recommend that you do not rely on the default values of the JVM ergonomics for a production system. In any case, setting at least the maximum of the Java heap value is good practice.



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.