Seeing `CMS: abort preclean due to time` in the gc.log; is this a cause for concern?
Environment
- Red Hat Enterprise Application Platform
- 7.x
- Red Hat build of OpenJDK
- 7
- 8
- CMS Collector
Issue
- Seeing
CMS: abort preclean due to time
in the gc.log; is this a cause for concern?
Resolution
The CMS collector goes through the following phases, only two of which are stop-the-world:
Phase | Type | Reason |
---|---|---|
CMS initial mark | stop-the-world phase | phase to mark the objects |
CMS marking | concurrent phase | actual marking objects |
CMS precleaning | concurrent phase | precleaning |
CMS abortable preclean | concurrent phase | pre-cleaning to avoid long STP ahead |
CMS Remark | stop-the-world phase | Remarking (moving objects from one segment to another) |
CMS sweep | concurrent phase | Sweeping phase |
CMS reset | concurrent phase | Reset the marking tables |
The error message above is printed if the abortable preclean phase exceeds the CMSMaxAbortablePrecleanTime
, which defaults to 5 seconds. If this is exceeded it then aborts this phase and continues to the next, which is a stop-the-world.
- If this message is repeatedly printed then it indicates that it is unable to complete the preclean phase in 5 seconds. Either the time needs to be increased to allow for a longer preclean phase, or the OS or heap needs to be examined to determine why this is not completing in the 5 seconds allotted.
Root Cause
The precleaning phase helps reduce the work in the next stop-the-world “remark” phase. Aborting this second precleaning phase is the expected behavior. That it was aborted is not an indication of an error. Since the remark phase is waiting, why not preclean but don't delay the remark for the sake of precleaning.
CMS AbortablePreclean takes more time than the default 5 sec and hence aborts.
Diagnostic Steps
GC logs show frequent preclean aborts due to time.
Eg:
CMS: abort preclean due to time 634260.811: [CMS-concurrent-abortable-preclean: 4.549/5.020 secs] [Times: user=4.91 sys=0.05, real=5.02 secs]
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments