Java 13 - ZGC Enhancements


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 limitation on returning unused heap memory to operating system like 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 limit.

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.

Useful Video Courses


Java Date and Time Online Training

16 Lectures 2 hours

Malhar Lathkar


Java Servlet Online Training

19 Lectures 5 hours

Malhar Lathkar


JavaScript Online Training

25 Lectures 2.5 hours

Anadi Sharma


Java Online Training

Most Popular

126 Lectures 7 hours

Tushar Kale


Java Essential Training

119 Lectures 17.5 hours

Monica Mittal


Java Essentials Online Training

76 Lectures 7 hours

Arnab Chakraborty