RFR: 8349906: G1: Improve initial survivor rate for newly used young regions [v2]
Thomas Schatzl
tschatzl at openjdk.org
Tue Feb 25 16:46:33 UTC 2025
> Hi all,
>
> please review this change that tries to improve the survivor rate initial values for newly expanded regions.
>
> Currently G1 uses `InitialSurvivorRate` as survivor rate for such regions, but it is typically a pretty bad choice because
>
> * it's rather conservative, estimating that 40% of region contents will survive
> * such a conservative value is kind of bad particularly in cases for regions that are expanded late in the mutator phase because they are not frequently updated (and with our running weights changes get propagated over a very long time), i.e. this 40% sticks for a long time (*)
> * it is a random value, i.e. not particularly specific to the application.
>
> The suggestion is to use the survivor rate for the last region we know the survivor rate already.
>
> (*) to clarify this a little: G1 keeps track of `[0...m]` survivor rate predictors. For a given garbage collection, `[0...n]` of those are updated (`n` is the number of eden/survivor regions depending on the rate group). However those for `]n...m]` are not, particularly those in that range that are seldom allocated, the predictors are not updated very frequently. Now the young gen sizing uses these predictions "at the end" of the predictor anyway, and since they are infrequently updated and their values are very conservative, G1 won't expand young gen as much as it could/should.
>
> Testing: gha, tier1-7 (with other changes)
>
> Hth,
> Thomas
Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
* kbarrett review: do not change the type of loop variable
* ayang review: use actual last value instead of prediction for newly allocated survivor rate groups
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/23584/files
- new: https://git.openjdk.org/jdk/pull/23584/files/5c4ded01..a09bc25e
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=23584&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=23584&range=00-01
Stats: 10 lines in 1 file changed: 7 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/23584.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23584/head:pull/23584
PR: https://git.openjdk.org/jdk/pull/23584
More information about the hotspot-gc-dev
mailing list