Skip to main content
PreparationZone Logo
PreparationZone
Back to Java

Java · Hard · Pro

Generational ZGC (Java 21+) — when prefer over G1?

JavaMemory & JVMStaff
Model answerPreview

Generational ZGC

ZGC was originally single-generation with ultra-low pauses; Java 21 added a generational mode that collects young objects more often—higher throughput for typical allocation-heavy services while keeping sub-millisecond pauses on many heaps.

Collector