Figure 6-6. A G1 young collection
Each small square in this figure represents a G1 region. The data in each region is represen-
ted by the black area of the region, and the letter in each region identifies the generation to
which the region belongs ([E]den, [O]ld generation, [S]urvivor space). Empty regions do not
belong to a generation; G1 uses them arbitrarily for whichever generation it deems necessary.
The G1 young collection is triggered when eden fills up (in this case, after filling four re-
gions). After the collection, there are no regions assigned to eden, since it is empty. There is
at least one region assigned to the survivor space (partially filled in this example), and some
data has moved into the old generation.
The GC log illustrates this collection a little differently in G1 than in other collectors. As
usual, the example log was taken using PrintGCDetails , but the details in the log for G1 are
more verbose. The examples show only a few of the important lines.
Here is the standard collection of the young generation: