The Garbage-First garbage collector (G1) is available for download
and testing in the Java SE 6 update 14 early access package. This next-generation, low-pause garbage collector will be included in the Java HotSpot virtual machine. G1 will be the long-term replacement for the Concurrent Mark-Sweep (or CMS) garbage collector, Sun's current low-pause garbage collector.
G1 targets medium to large multiprocessor machines and large heaps, relying heavily on the concurrency and parallelism such machines offer
. Like CMS, G1 is generational, which benefits throughput. Unlike CMS, G1 compacts to battle fragmentation and to achieve more-consistent long-term operation. As its name suggests, G1 concentrates its collection and compaction activity first on the areas of the heap that are likely to be full of reclaimable objects, thus improving its efficiency.
G1 uses a pause prediction model to meet user-defined pause time targets. It achieves smoother pause times than CMS, with fewer or no outliers at comparable or better throughput. The initial target pause times are in the low tens of milliseconds.
A research paper presenting a detailed analysis of G1 is available for download
(PDF, 164 KB) as well.