Java Reference
In-Depth Information
Wait, didn't CMS just execute a preclean phase? What's up with this abortable preclean
phase?
The abortable preclean phase is used because the remark phase (which, strictly speaking, is
the final entry in this output) is not concurrent—it will stop all the application threads. CMS
wants to avoid the situation where a young generation collection occurs and is immediately
followed by a remark phase, in which case the application threads would be stopped for two
back-to-back pause operations. The goal here is to minimize pause lengths by preventing
back-to-back pauses.
Hence, the abortable preclean phase waits until the young generation is about 50% full. In
theory, that is halfway between young generation collections, giving CMS the best chance to
avoid those back-to-back pauses. In this example, the abortable preclean phase starts at 90.8
seconds and waits about 1.5 seconds for the regular young collection to occur (at 92.392
seconds into the log). CMS uses past behavior to calculate when the next young collection is
likely to occur—in this case, CMS calculated it would occur in about 4.2 seconds. So after
2.1 seconds (at 94.4 seconds), CMS ends the preclean phase (which it calls “aborting” the
phase, even though that is the only way the phase is stopped). Then, finally, CMS executes
the remark phase, which pauses the application threads for 0.18 seconds (the application
threads were not paused during the abortable preclean phase).
Next comes another concurrent phase—the sweep phase:
94.661: [CMS-concurrent-sweep-start]
95.223: [GC 95.223: [ParNew: 629120K->69888K(629120K), 0.1322530 secs]
999428K->472094K(2027264K), 0.1323690 secs]
[Times: user=0.43 sys=0.00, real=0.13 secs]
95.474: [CMS-concurrent-sweep: 0.680/0.813 secs]
[Times: user=1.45 sys=0.00, real=0.82 secs]
This phase took 0.82 seconds and ran concurrently with the application threads. It also
happened to be interrupted by a young collection. This young collection had nothing to do
with the sweep phase, but it is left in here as an example that the young collections can occur
simultaneously with the old collection phases. In Figure 6-5 , notice that the state of the
young generation changed during the concurrent collection—there may have been an arbit-
rary number of young collections during the sweep phase (and there will have been at least
one young collection because of the abortable preclean phase).
Next comes the concurrent reset phase:
Search WWH ::




Custom Search