Jump to Summary Table

The main drawback of most garbage collectors is the need for long application pauses. These pauses are the result of an inevitable requirement to compact the heap to free up space. Collectors use different strategies to delay these events, but compaction is inevitable for all commercial available collectors except the Azul C4 which employs a Continuously Concurrent Compacting Collector that avoids pauses altogether.

The C4 (Continuously Concurrent Compacting Collector) is an updated generational form of the Azul Pauseless GC Algorithm and is the default collector of Zing®. C4 differentiates itself from other generational garbage collectors by supporting simultaneous - generational concurrency: the different generations are collected using concurrent (non stop-the-world) mechanisms that can be simultaneously and independently active. Unlike other algorithms, it is not ‘mostly’ concurrent, but fully concurrent, so it never falls back to a stop-the-world compaction.

A summary of garbage collectors is below. For more information on the terminology and more details on the collectors, read the Understanding Java GC white paper.

JVM

Collector Name

Young Generation

Old Generation

Oracle's HotSpot

ParallelGC

Monolithic, stop the world, copying

Monolithic, stop-the-world, Mark/Sweep/Compact

Oracle's HotSpot

CMS (Concurrent Mark/Sweep)

Monolithic, stop the world, copying

Mostly concurrent marker, concurrent, non-compacting sweeper, fall back to monolithic stop-the-world compaction

Oracle's HotSpot

G1 (Garbage First)

Monolithic, stop the world, copying

Mostly concurrent marker, mostly incremental compaction, fall back to monolithic stop-the-world

Oracle's JRockit*

Dynamic Garbage Collector

Monolithic, stop-the-world, copying

Mark/Sweep - can choose mostly concurrent or parallel, incremental compaction, fall back to monolithic stop-the-world

IBM J9*

Balanced

Monolithic, stop-the-world, copying

Mostly concurrent marker, mostly incremental compaction, fall back to monolithic stop-the-world

IBM J9*

optthruput

Monolithic, stop-the-world, copying

Parallel Mark/Sweep, stop-the-world compaction

Azul Zing

C4 (Continuously Concurrent Compacting Collector)

Concurrent, compacting

Concurrent, compacting

Garbage Collection (GC) is an integral part of application behavior on Java platforms. Java developers can improve application performance, scalability and reliability by understanding how GC works and by making better garbage collector choices.

More resources:

*Note that with IBM's J9 and Oracle's JRockit you can choose to have a single or 2-generation garbage collector