Tuning Java Virtual Machine

Find Default JVM configurations in a machine:
java -XX:+PrintFlagsFinal -version

Defualt Heap Size in a JVM
java -XX:+PrintFlagsFinal -version | grep HeapSize

Defines the heap size calculation

Performance Improvements

introduces improvements in the following areas:

* Faster jar File Creation

* The fix of a long standing bug related to jar file creation has greatly improved creation time. For example, for a given jar file, it is possible that you might see a creation time improvement in the range of 20 percent. (Refer to 6496274.)
Java Hotspot VM 16.0

* includes version 16.0 of the Java HotSpot Virtual Machine. Contributing to increased performance in this release are several enhancements in Java HotSpot VM 16.0. These include:
Improved NUMA-aware allocation
Extensions to compressed object pointers

* Garbage collection improvements

* Updated Client JVM heap configuration

* In the Client JVM, the default Java heap configuration has been modified to improve the performance of today’s rich client applications. Initial and maximum heap sizes are larger and settings related to generational garbage collection are better tuned.
* 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 1 gigabyte.

For example, if your machine has 128 megabytes of physical memory, then the maximum heap size is 64 megabytes, and greater than or equal to 1 gigabyte of physical memory results in a maximum heap size of 256 megabytes.

* The maximum heap size is not actually used by the JVM unless your program creates enough objects to require it. A much smaller amount, termed the initial heap size, is allocated during JVM initialization. This amount is at least 8 megabytes and otherwise 1/64 of physical memory up to a physical memory size of 1 gigabyte.

* The maximum amount of space allocated to the young generation is one third of the total heap size. The updated heap configuration ergonomics apply to all collectors except Concurrent Mark-Sweep (CMS). CMS heap configuration ergonomics remain the same.

* Server JVM heap configuration ergonomics are now the same as the Client, except that the default maximum heap size for 32-bit JVMs is 1 gigabyte, corresponding to a physical memory size of 4 gigabytes, and for 64-bit JVMs is 32 gigabytes, corresponding to a physical memory size of 128 gigabytes.

* JVM Memory Partition

The different generations of data defined by the Garbage Collector

Reference: