RFR: 8351405: G1: Collection set early pruning causes suboptimal region selection
Kirk Pepperdine
kirk at kodewerk.com
Mon Mar 17 15:26:18 UTC 2025
Hi Ivan,
Not a review but this change looks good. I’ve also noted that the last mixed collection in the set always takes longer than the previous mixed. Does this patch address that spike?
Kind regards,
Kirk
> On Mar 17, 2025, at 5:40 AM, Ivan Walulya <iwalulya at openjdk.org> wrote:
>
> 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.
>
> 
>
>
> Testing: Tier 1-3.
>
> -------------
>
> Commit messages:
> - remove double prune
> - save
> - revise region selection
> - save
> - init
>
> Changes: https://git.openjdk.org/jdk/pull/24076/files
> Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24076&range=00
> Issue: https://bugs.openjdk.org/browse/JDK-8351405
> Stats: 79 lines in 11 files changed: 66 ins; 2 del; 11 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