ZGC
A highly concurrent HotSpot garbage collector designed to keep pause times low even with very large heaps by performing most work concurrently with the application.
ZGC (Z Garbage Collector) is a HotSpot garbage-collection family designed to keep application pauses low by performing most collection work concurrently with the application.
JVM Runtime Context
ZGC performs most garbage-collection work concurrently with application threads and is designed for very low pause times across large heaps. In modern JDKs its generational mode is the relevant design, but collector choice should still consider throughput, CPU headroom, allocation rate, and memory footprint.
Performance Boundary
Low pauses do not mean zero GC cost. Concurrent marking, relocation, barriers, and background work consume CPU and memory bandwidth that would otherwise be available to the application.
Related JVM Concepts
Source
- https://openjdk.org/projects/jdk/25/
Version Line and What to Measure
JDK version is part of the semantics when evaluating ZGC. JEP 439 introduced Generational ZGC in JDK 21, and JEP 474 made the generational mode the default in JDK 23. Saying only "the application uses ZGC" is therefore insufficient to identify the collector behavior and feature set being evaluated.
A low stop-the-world pause target does not mean low total GC cost. Concurrent marking and relocation, barriers, and GC threads share CPU and memory bandwidth with application work. A useful comparison should examine more than maximum pause: p50/p95/p99 pauses, allocation rate, application throughput, CPU consumption, and heap/working-set behavior should be measured together. Tail Latency and Allocation Rate are therefore part of collector evaluation.