- Java 13 - ZGC Enhancements
- Java 13 - Dynamic CDS Archive
- Java 13 - Miscellaneous Changes
- Java 13 - Socket API Reimplementation
- Java 13 - Text Block Methods
- Java 13 - Text Blocks
- Java 13 - Switch Expressions
- Java 13 - Environment Setup
- Java 13 - Overview
- Java 13 - Home
Java Other Versions Tutorials
Java 13 Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
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 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.