RFR: JDK-8262068: Improve G1 Full GC by skipping compaction for regions with high survival ratio [v5]

Hamlin Li mli at openjdk.java.net
Thu Mar 4 12:54:04 UTC 2021


> 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

Hamlin Li has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:

  reuse vm option MarkSweepDeadRatio; reuse G1RegionMarkStatsCache class; fix regression in Mark phase by inlining live words collection into mark_object()

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2760/files
  - new: https://git.openjdk.java.net/jdk/pull/2760/files/9956ab84..d7cf5fc8

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2760&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2760&range=03-04

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2760.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2760/head:pull/2760

PR: https://git.openjdk.java.net/jdk/pull/2760



More information about the hotspot-gc-dev mailing list