Java Reference
In-Depth Information
Figure 6-8. Mixed GC performed by G1
As is usual for a young collection, G1 has completely emptied eden and adjusted the survivor
spaces. Additionally, two of the marked regions have been collected. Those regions were
known to contain mostly garbage, and so a large part of them was freed. Any live data in
those regions was moved to another region (just as live data was moved from the young gen-
eration into regions in the old generation). This is why G1 ends up with a fragmented heap
less often than CMS—moving the objects like this is compacting the heap as G1 goes along.
The mixed GC operation looks like this in the log:
79.826: [GC pause (mixed), 0.26161600 secs]
....
[Eden: 1222M(1222M)->0B(1220M)
Survivors: 142M->144M Heap: 3200M(4096M)->1964M(4096M)]
[Times: user=1.01 sys=0.00, real=0.26 secs]
Notice that the entire heap usage has been reduced by more than just the 1,222 MB removed
from eden. That difference (16 MB) seems small, but remember that some of the survivor
Search WWH ::




Custom Search