Request for review - 8022817: CMS should not shrink if compaction was not done
8022817: CMS should not shrink if compaction was not done If UseCMSCompactAtFullCollection is turned off, a full GC that is done in the foreground but does not compact should not shrink the generation. In that case a mark-sweep was done so the free space is maintained in freelists (not as a contiguous area at the end of the generation) and shrinking for freelists is not implemented. http://cr.openjdk.java.net/~jmasa/8022817/webrev.00/ Thanks. Jon
Looks OK to me. Aside: Is all of that code for ASConcurrentMarkSweepGeneration planned to be used, or is it best to get rid of all the dead code? -- ramki On Mon, Aug 12, 2013 at 12:09 PM, Jon Masamitsu <jon.masamitsu@oracle.com> wrote:
8022817: CMS should not shrink if compaction was not done
If UseCMSCompactAtFullCollection is turned off, a full GC that is done in the foreground but does not compact should not shrink the generation. In that case a mark-sweep was done so the free space is maintained in freelists (not as a contiguous area at the end of the generation) and shrinking for freelists is not implemented.
http://cr.openjdk.java.net/~jmasa/8022817/webrev.00/
Thanks.
Jon
Ramki, Thanks for the review. On 8/14/2013 1:37 AM, Srinivas Ramakrishna wrote:
Looks OK to me.
Aside: Is all of that code for ASConcurrentMarkSweepGeneration planned to be used, or is it best to get rid of all the dead code?
It depends :-). If we implement a throughput mode in G1 and decide to reimplement the throughtpu GC ergonomics, then we will remove this code. The code such as in ASConcurrentMarkSweepGeneration is the GC ergonomics implemented in the G1 style (shared with CMS) and would be reusable in the a G1 throughput mode with the same (or derivative) GC ergonomics. My opinion. Jon
-- ramki
On Mon, Aug 12, 2013 at 12:09 PM, Jon Masamitsu <jon.masamitsu@oracle.com> wrote:
8022817: CMS should not shrink if compaction was not done
If UseCMSCompactAtFullCollection is turned off, a full GC that is done in the foreground but does not compact should not shrink the generation. In that case a mark-sweep was done so the free space is maintained in freelists (not as a contiguous area at the end of the generation) and shrinking for freelists is not implemented.
http://cr.openjdk.java.net/~jmasa/8022817/webrev.00/
Thanks.
Jon
Jon, On 2013-08-12 21:09, Jon Masamitsu wrote:
8022817: CMS should not shrink if compaction was not done
If UseCMSCompactAtFullCollection is turned off, a full GC that is done in the foreground but does not compact should not shrink the generation. In that case a mark-sweep was done so the free space is maintained in freelists (not as a contiguous area at the end of the generation) and shrinking for freelists is not implemented.
I would prefer if the !did_compact() check was pulled up to ConcurrentMarkSweepGeneration::shrink instead. My reasoning is that shrink() already does a check for size > 0 before calling shrink_by() to do the actual work. I think it would be clearer if shrink() did the checks and shrink_by() did the unconditional shrinking. /Mikael
Thanks.
Jon
On 8/14/2013 3:28 AM, Mikael Gerdin wrote:
Jon,
On 2013-08-12 21:09, Jon Masamitsu wrote:
8022817: CMS should not shrink if compaction was not done
If UseCMSCompactAtFullCollection is turned off, a full GC that is done in the foreground but does not compact should not shrink the generation. In that case a mark-sweep was done so the free space is maintained in freelists (not as a contiguous area at the end of the generation) and shrinking for freelists is not implemented.
I would prefer if the !did_compact() check was pulled up to ConcurrentMarkSweepGeneration::shrink instead.
My reasoning is that shrink() already does a check for size > 0 before calling shrink_by() to do the actual work. I think it would be clearer if shrink() did the checks and shrink_by() did the unconditional shrinking.
I like it. I made the change. Thanks. Jon
/Mikael
Thanks.
Jon
I've updated the webrev based on review comments (thanks, Ramki and Mikael) http://cr.openjdk.java.net/~jmasa/8022817/webrev.01/ This webrev is based on the repository for the fix for 8021809. Thanks. Jon On 8/12/2013 12:09 PM, Jon Masamitsu wrote:
8022817: CMS should not shrink if compaction was not done
If UseCMSCompactAtFullCollection is turned off, a full GC that is done in the foreground but does not compact should not shrink the generation. In that case a mark-sweep was done so the free space is maintained in freelists (not as a contiguous area at the end of the generation) and shrinking for freelists is not implemented.
http://cr.openjdk.java.net/~jmasa/8022817/webrev.00/
Thanks.
Jon
Jon, On 2013-08-16 15:25, Jon Masamitsu wrote:
I've updated the webrev based on review comments (thanks, Ramki and Mikael)
The change looks good. /Mikael
This webrev is based on the repository for the fix for 8021809.
Thanks.
Jon
On 8/12/2013 12:09 PM, Jon Masamitsu wrote:
8022817: CMS should not shrink if compaction was not done
If UseCMSCompactAtFullCollection is turned off, a full GC that is done in the foreground but does not compact should not shrink the generation. In that case a mark-sweep was done so the free space is maintained in freelists (not as a contiguous area at the end of the generation) and shrinking for freelists is not implemented.
http://cr.openjdk.java.net/~jmasa/8022817/webrev.00/
Thanks.
Jon
participants (3)
-
Jon Masamitsu
-
Mikael Gerdin
-
Srinivas Ramakrishna