Java Reference
In-Depth Information
The second problem occurs when there is enough room in the old generation to hold the pro-
moted objects, but the free space is fragmented and so the promotion fails:
6043.903: [GC 6043.903:
[ParNew (promotion failed): 614254K->629120K(629120K), 0.1619839 secs]
6044.217: [CMS: 1342523K->1336533K(2027264K), 30.7884210 secs]
2004251K->1336533K(1398144K),
[CMS Perm : 57231K->57231K(95548K)], 28.1361340 secs]
[Times: user=28.13 sys=0.38, real=28.13 secs]
Here, CMS started a young collection and assumed that there was enough free space to hold
all the promoted objects (otherwise, it would have declared a concurrent mode failure). That
assumption proved incorrect: CMS couldn't promote the objects because the old generation
was fragmented (or, much less likely, because the amount of memory to be promoted was
bigger than CMS expected).
As a result, in the middle of the young collection (when all threads were already stopped),
CMS collected and compacted the entire old generation. The good news is that with the heap
compacted, fragmentation issues have been solved (at least for a while). But that came with a
hefty 28-second pause time. This time is much longer than when CMS had a concurrent
mode failure because the entire heap was compacted; the concurrent mode failure simply
freed objects in the heap. The heap at this point appears as it did at the end of the throughput
collector's full GC ( Figure 6-2 ) : the young generation is completely empty, and the old gen-
eration has been compacted.
Finally, the CMS log may show a full GC without any of the usual concurrent GC messages:
279.803: [Full GC 279.803:
[CMS: 88569K->68870K(1398144K), 0.6714090 secs]
558070K->68870K(2027264K),
[CMS Perm : 81919K->77654K(81920K)],
0.6716570 secs]
This occurs when permgen has filled up and needs to be collected; notice that the size of the
CMS Perm space has dropped. In Java 8, this can also occur if the metaspace needs to be res-
ized. By default, CMS does not collect permgen (or the metaspace), so if it fills up, a full GC
is needed to discard any unreferenced classes. The advanced tuning section for CMS shows
how to overcome this issue.
Search WWH ::




Custom Search