Request for review - 8022817: CMS should not shrink if compaction was not done

Jon Masamitsu jon.masamitsu at oracle.com
Thu Aug 15 03:55:47 UTC 2013


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.
>>
>> http://cr.openjdk.java.net/~jmasa/8022817/webrev.00/
>
> 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




More information about the hotspot-gc-dev mailing list