RFR of JDK-8262068: Improve G1 Full GC by skipping compaction for regions with high survival ratio
Hamlin
lihuaming3 at huawei.com
Sat Feb 27 07:01:41 UTC 2021
webrev of original stype:
https://openjdk.github.io/cr/?repo=jdk&pr=2760&range=00
在 2021/2/27 14:59, Hamlin 写道:
>
> Just modified some typo in the original email, please check below
> content to review again.
>
> Thanks,
>
> Hamlin
>
> 在 2021/2/27 14:32, Hamlin 写道:
>>
>> Hi,
>>
>> Would you please help to review an improvement in G1 full GC?
>>
>> bug: https://bugs.openjdk.java.net/browse/JDK-8262068
>>
>> webrev:
>> https://github.com/openjdk/jdk/pull/2760/commits/4be6c18e2201fc8d22ee0f31d11ca7892be21a43
>>
>> Summary
>> -----------
>>
>> Improve G1 Full GC by skip compaction for regions with high survival
>> ratio.
>>
>> Backgroud
>> -----------
>>
>> There are 4 steps in full gc of G1 GC.
>> - mark live objects
>> - prepare forwardee
>> - adjust pointers
>> - compact
>>
>> When full gc occurs, there may be very high percentage of live bytes
>> in some regions. For these regions, it's not efficient to compact
>> them and better to skip them, as there are little space to save but
>> many objects to copy.
>>
>> Description
>> -----------
>>
>> We enhance the full gc implementation for the above situation through
>> following steps:
>> - accumulate live bytes of every hr in mark phase;
>> - add hr's with high percentage of live bytes into a "no moving" set
>> rather the normal compaction set in prepare phase, and fill dummy
>> objects in the places of dead objects in these hr's;
>> - nothing special is done in adjust phase;
>> - just compact the regions in compaction set;
>>
>> VM options added
>> -----------
>>
>> - G1SkipCompactionLiveBytesLowerThreshold: The lower threshold of
>> heap region live bytes percent in G1 full GC
>>
>> Test
>> -----------
>>
>> - specjbb2015: no regression
>> - dacapo: 3%-11% improvement of full gc pause. Attachment is the
>> dacapo h2 full gc pause.
>>
>> $ java -Xmx1g -Xms1g -XX:G1SkipCompactionLiveBytesLowerThreshold=98
>> -XX:ParallelGCThreads=4 -Xlog:gc*=info:file=gc.log -jar
>> dacapo-9.12-bach.jar --iterations 5 --size huge --no-pre-iteration-gc h2
>>
>>
>> Thanks,
>>
>> Hamlin
>>
More information about the hotspot-gc-dev
mailing list