Skip to content

Conversation

@tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Feb 12, 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


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8349906: G1: Improve initial survivor rate for newly used young regions (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23584/head:pull/23584
$ git checkout pull/23584

Update a local copy of the PR:
$ git checkout pull/23584
$ git pull https://git.openjdk.org/jdk.git pull/23584/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23584

View PR using the GUI difftool:
$ git pr show -t 23584

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23584.diff

Using Webrev

Link to Webrev Comment

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.

Testing: gha, tier1-7 (with other changes)

Hth,
  Thomas
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 12, 2025

👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Feb 12, 2025

@tschatzl This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8349906: G1: Improve initial survivor rate for newly used young regions

Reviewed-by: kbarrett, iwalulya

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 170 new commits pushed to the master branch:

  • a70eba8: 8330174: Protection zone for easier detection of accidental zero-nKlass use
  • f529bf7: 8350483: AArch64: turn on signum intrinsics by default on Ampere CPUs
  • 037e471: 8350666: cmp-baseline builds fail after JDK-8280682
  • c8a521f: 8345213: JVM Prefers /etc/timezone Over /etc/localtime on Debian 12
  • 86024eb: 8348426: Generate binary file for -XX:AOTMode=record -XX:AOTConfiguration=file
  • 267d69b: 8326447: jpackage creates Windows installers that cannot be signed
  • 2efb033: 8350601: Miscellaneous updates to jpackage test lib
  • d4fdc79: 8344981: [REDO] JDK-6672644 JComboBox still scrolling if switch to another window and return back
  • b78043f: 8320220: Compilation of cyclic hierarchy causes infinite recursion
  • a3188e0: 8349991: GraphUtils.java can use String.replace() instead of String.replaceAll()
  • ... and 160 more: https://git.openjdk.org/jdk/compare/8e8582949669d5f3dcb68886ccb6a719393d1a9e...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title 8349906 8349906: G1: Improve initial survivor rate for newly used young regions Feb 12, 2025
@openjdk
Copy link

openjdk bot commented Feb 12, 2025

@tschatzl The following label will be automatically applied to this pull request:

  • hotspot-gc

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Feb 12, 2025
@tschatzl tschatzl marked this pull request as ready for review February 12, 2025 11:49
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 12, 2025
@mlbridge
Copy link

mlbridge bot commented Feb 12, 2025

Webrevs

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 13, 2025
* ayang review: use actual last value instead of prediction for newly allocated survivor rate groups
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Feb 25, 2025
Copy link

@kimbarrett kimbarrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 26, 2025
@tschatzl
Copy link
Contributor Author

Thanks @kimbarrett @walulyai for your reviews

/integrate

@openjdk
Copy link

openjdk bot commented Feb 26, 2025

Going to push as commit aac9cb4.
Since your change was applied there have been 171 commits pushed to the master branch:

  • a431046: 8350518: org.openjdk.bench.java.util.TreeMapUpdate.compute fails with "java.lang.IllegalArgumentException: key out of range"
  • a70eba8: 8330174: Protection zone for easier detection of accidental zero-nKlass use
  • f529bf7: 8350483: AArch64: turn on signum intrinsics by default on Ampere CPUs
  • 037e471: 8350666: cmp-baseline builds fail after JDK-8280682
  • c8a521f: 8345213: JVM Prefers /etc/timezone Over /etc/localtime on Debian 12
  • 86024eb: 8348426: Generate binary file for -XX:AOTMode=record -XX:AOTConfiguration=file
  • 267d69b: 8326447: jpackage creates Windows installers that cannot be signed
  • 2efb033: 8350601: Miscellaneous updates to jpackage test lib
  • d4fdc79: 8344981: [REDO] JDK-6672644 JComboBox still scrolling if switch to another window and return back
  • b78043f: 8320220: Compilation of cyclic hierarchy causes infinite recursion
  • ... and 161 more: https://git.openjdk.org/jdk/compare/8e8582949669d5f3dcb68886ccb6a719393d1a9e...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 26, 2025
@openjdk openjdk bot closed this Feb 26, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Feb 26, 2025
@openjdk
Copy link

openjdk bot commented Feb 26, 2025

@tschatzl Pushed as commit aac9cb4.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@tschatzl tschatzl deleted the submit/8349906-survivor-rate-expand branch February 26, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants