<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
The partitioning of eden for parallel CMS initial mark and remark <br>
depends of the setting of _eden_chunk_index to correctly reflect<br>
the occupancy of eden. For example if _eden_chunk_index is 3,<br>
then eden should be dividable into 3 chunks, each chunk<br>
available for parallel processing. In particular after a young<br>
gen collection when eden is empty, the broken code depends on<br>
_eden_chunk_index being 0. The resetting of _eden_chunk_index<br>
is done in the gc_epilogue() of the CMS gen. When<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
1) a System.gc() is called
<br>
<br>
and
<br>
<br>
2) UseCMSCompactAtFullCollection is set to false
<br>
<br>
the CMS generation tells GenCollectedHeap that CMS
<br>
does not collect the young gen. So the young gen is<br>
collected first and then the CMS gen is collected. In<br>
this case the CMS gen gc_epilogue() is not called<br>
after the young gen collection and _eden_chunk_index<br>
is not cleared. The gc_epilogue() methods are called after the<br>
completion of the collection (after the CMS gen is<br>
collected). This is the expected behavior for when the<br>
gc_epilogue() is called.<br>
<br>
This fix adds a guard that checks if eden is empty, <br>
skipping eden processing if it is.<br>
<br>
<a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~jmasa/8021809/webrev.00/">http://cr.openjdk.java.net/~jmasa/8021809/webrev.00/</a>
</body>
</html>