RFR: 8351405: G1: Collection set early pruning causes suboptimal region selection [v3]

Ivan Walulya iwalulya at openjdk.org
Mon Mar 24 12:56:50 UTC 2025


> Hi all,
> 
> Please review this change which aims to reduce spikes in mixed GCs, especially the last mixed-gc in a mixed cycle. Currently, G1 sorts regions identified for collection by reclaimable bytes, then prunes the list removing regions that with the lowest amount of reclaimable bytes. The pruned list is then split into collection groups which are later sorted on gc-efficiency. 
> 
> In the cachestress benchmark, we run into a case where some regions contain onlya  few live objects but having many incoming references from other regions.  These regions very expensive collect (low gc-efficiency).
> 
> This patch improves the pruning process by tracking incoming references to regions during marking. Instead of pruning based on reclaimable bytes alone, we estimate GC efficiency beforehand and prune regions with the worst GC efficiency.
> 
> This reduces the spikes in gc pause time as shown for cachestress benchmark in the image below. 
> 
> ![mixed-gc](https://github.com/user-attachments/assets/740fb51d-eb20-4946-bf90-4eef23afe2e4)
> 
> 
> Testing: Tier 1-3.

Ivan Walulya has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:

 - Albert Review
 - Merge remote-tracking branch 'upstream/master' into ReviseRegionSelection
 - Thomas Review
 - remove double prune
 - save
 - revise region selection
 - save
 - init

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24076/files
  - new: https://git.openjdk.org/jdk/pull/24076/files/f5fa92f0..649651a8

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24076&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24076&range=01-02

  Stats: 64054 lines in 1111 files changed: 31939 ins; 20494 del; 11621 mod
  Patch: https://git.openjdk.org/jdk/pull/24076.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24076/head:pull/24076

PR: https://git.openjdk.org/jdk/pull/24076


More information about the hotspot-gc-dev mailing list