Concurrent Garbage collectors: ZGC & Shenandoah
summary
Java 11/12 add ZGC and Shenandoah, both single-generation collectors that do concurrent marking and concurrent compaction to cut pauses from tens of milliseconds to a few or under one millisecond in tested workloads. ZGC uses colored pointers plus a cheap load barrier (measured ~4% CPU hit) and requires 64-bit Linux and triple virtual-to-physical mapping (RSS can appear 3x, triggering cloud OOM killers). Shenandoah uses Brooks/forward pointers (1.0) and a simpler 2.0 invariant, is multi-platform and backported to JDK 8/11.
AI-written summary · about
chapters (14)
- 0:00Introduction to garbage collection
- 1:45Problems with stop-the-world GC
- 3:52G1 garbage collector overview
- 5:17ZGC and Shenandoah introduction
- 9:16Concurrency challenges in GC
- 10:19ZGC deep dive
- 17:12ZGC race condition solution
- 25:43ZGC relocation example
- 32:29Shenandoah overview
- 37:58Shenandoah Brooks pointers
- 41:32Shenandoah 1.0 vs 2.0
- 53:30Shenandoah relocation example
- 55:35Tuning Shenandoah
- 58:05Conclusion and recommendations
