What is the default garbage collector in Java 9 and later?
Answer
G1 (Garbage-First)
Answer
G1 (Garbage-First)
The default garbage collector in Java 9 and later is G1, short for Garbage-First.
Oracle made G1 the default in JDK 9, replacing Parallel GC as the usual default for server-class machines. G1 divides the heap into many regions and prioritizes regions containing the most reclaimable garbage, which explains the “garbage-first” name. Its design aims to balance throughput with predictable pause-time goals.
G1 is a tracing, generational collector: it separates young and old objects logically while managing the heap by regions. It can perform much of its work concurrently with application threads and is designed for large heaps and multiprocessor systems. The default does not mean G1 is mandatory; users can select another collector with JVM options, and JVM ergonomics can vary with available hardware and configuration.
A common mix-up is confusing G1 with CMS. CMS was a concurrent collector deprecated in JDK 9 and later removed. G1 is also not the same as the newer ZGC or Shenandoah collectors, which target different latency and scalability requirements.
Source: Wikipedia · fact-checked Aug. 2026