The Z Garbage Collector
The Z Garbage Collector (ZGC) is a scalable low latency garbage collector designed for large applications. ZGC performs all expensive work concurrently, without stopping the execution of application threads. ZGC provides max pause times of a few milliseconds, but at the cost of some throughput. It is intended for applications which require low latency.Pause times are independent of heap size that is being used. ZGC supports heap sizes from 8 MB to 16 TB.
The Z Garbage Collector can be enabled with the command-line option
-XX:+UseZGC .
If you are interested in learning more about how ZGC works, see The Z Garbage Collector Collector in the HotSpot Virtual Machine Garbage Collection Tuning Guide. (Note: this link is to the documentation for JDK 25, but the information contained therein applies to ZGC regardless of JDK version.)
Last reviewed on Sat Feb 01 2025 00:00:00 GMT+0000 (Coordinated Universal Time)