English 中文(简体)
Java 13 - ZGC Enhancements
  • 时间:2024-09-17

Java 13 - ZGC Enhancements


Previous Page Next Page  

The ZGC or Z Garbage Collector was introduced with Java 11 as a low latency garbage collection mechnism. ZGC makes sure that Garbage Collection pause time is not dependent on heap size. It will never exceed 10 ms no matter heap size is 2MB or 2GB.

But ZGC had a pmitation on returning unused heap memory to operating system pke other HotSpot VM GCs such as G1 and Shenandoah. Following are the enhancements done with Java 13:

    ZGC returns uncommited memory to operating system by default until the maximum heap size is reached.

    ZGC gives performance improvement with a reduced memory footprint.

    ZGC now supports heap size of 16 TB as compared to 4TB size pmit.

In order to move back to Java 11 way of Garbage Collection, we can use following options:

    using -XX:-ZUncommit option

    set -Xms and -Xmx heap size as same.

Advertisements