After the root region scanning, G1 enters a concurrent marking phase. This happens com-
pletely in the background; a message is printed when it starts and ends:
111.382: [GC concurrent-mark-start]
120.905: [GC concurrent-mark-end, 9.5225160 sec]
Concurrent marking can be interrupted, so young collections may occur during this phase.
The marking phase is followed by a remarking phase and a normal cleanup phase:
120.910: [GC remark 120.959:
[GC ref-PRC, 0.0000890 secs], 0.0718990 secs]
[Times: user=0.23 sys=0.01, real=0.08 secs]
120.985: [GC cleanup 3510M->3434M(4096M), 0.0111040 secs]
[Times: user=0.04 sys=0.00, real=0.01 secs]
These phases stop the application threads, though usually for a quite short time. Next there is
an additional cleanup phase that happens concurrently:
120.996: [GC concurrent-cleanup-start]
120.996: [GC concurrent-cleanup-end, 0.0004520]
And with that, the normal G1 cycle is complete—insofar as finding the garbage goes, at
least. But very little has actually been freed yet. A little memory was reclaimed in the
cleanup phase, but all G1 has really done at this point is to identify old regions that are
mostly garbage and can be reclaimed (the ones marked with an X in Figure 6-7 ).
Now G1 executes a series of mixed GCs. They are called mixed because they perform the
normal young collection, but they also collect some number of the marked regions from the
background scan. The effect of a mixed GC is shown in Figure 6-8 .