Garbage Collector: How to Tame the Beast and Make It Your Best Ally
summary
Compares OpenJDK garbage collectors (Serial, Parallel, G1, Shenandoah, ZGC) and Azul C4 by replaying a Michel control-based workload with JFR traces and measuring runtime and request latencies. Finds Serial spends ~15% of time in GC with ~244M GC events; Parallel gives the best throughput (about 97% application time) and a small young-generation size tweak saves ~4s. G1 suffers humongous-object fragmentation unless region size is increased (8→16 MB cuts runtime to ~105s), while ZGC and Shenandoah reduce p99 latency and Azul C4 yields the lowest tail latencies.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:03Serial GC: how it works and use cases
- 5:16Parallel GC: parallelism and optimizations
- 9:06G1 GC: regions and garbage first
- 13:47Shenandoah GC: concurrent and compact
- 16:14ZGC: ultra-low latency
- 18:20Choosing GC for your app
- 26:28Tuning Parallel GC
- 29:00Handling humongous objects in G1
- 32:34Dynamic G1 tuning
- 35:24Shenandoah and ZGC: advanced optimizations
- 38:13When to avoid G1 and alternatives
- 41:26Conclusion
related talks
25mGarbage Collection Primer
16mGarbage Collectors: Battle Royale
44mMastering GC: tame the beast and make it your best ally
01h 01mOpenJDK: In the new age of Concurrent Garbage Collectors
52mGarbage collection for the humans
49mConcurrent Garbage Collectors: ZGC & Shenandoah
45mJava Garbage Collectors’ Current Performance Impact
19mZ Garbage Collector: The Next Generation
