Java
Types of Garbage Collectors in Java
A reference to Java garbage collectors and their approaches to throughput, pauses, and memory.
5 views
- Serial GC: Single-threaded, stop-the-world collector for small apps or single-core systems.
- Parallel GC: Multi-threaded, throughput-focused collector with stop-the-world pauses.
- Concurrent Mark-Sweep (CMS) GC: Mostly concurrent, low-latency collector, deprecated due to fragmentation.
- G1 (Garbage-First) GC: Region-based, balances throughput and pause time, default since Java 9.
- Z Garbage Collector (ZGC): Low-latency, concurrent GC for large heaps with minimal pauses.
- Shenandoah GC: Low-latency, concurrent compaction for consistent response times.
- Epsilon GC: No-op GC for testing or short-lived apps, no memory reclamation.