Skip to content

8236073: G1: Use SoftMaxHeapSize to guide GC heuristics#27524

Closed
tschatzl wants to merge 9 commits intoopenjdk:masterfrom
tschatzl:submit/8236073-softmaxheapsize
Closed

8236073: G1: Use SoftMaxHeapSize to guide GC heuristics#27524
tschatzl wants to merge 9 commits intoopenjdk:masterfrom
tschatzl:submit/8236073-softmaxheapsize

Conversation

@tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Sep 26, 2025

Hi all,

please review this change to implement SoftMaxHeapSize for G1.

Main change is that SoftMaxHeapSize now impacts the G1IHOPControl::target_occupancy(), i.e. the amount of bytes G1 when reclaim should start.

Most of the other changes are just about updating logging/JFR and making sure that the SoftMaxHeapSize values are consistent across calls.

Testing: tier1-5

Thanks,
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

Warnings

 ⚠️ Patch contains a binary file (src/java.base/share/classes/jdk/internal/icu/impl/data/icudt76b/nfc.nrm)
 ⚠️ Patch contains a binary file (src/java.base/share/classes/jdk/internal/icu/impl/data/icudt76b/ubidi.icu)
 ⚠️ Patch contains a binary file (src/java.base/share/classes/jdk/internal/icu/impl/data/icudt76b/uprops.icu)
 ⚠️ Patch contains a binary file (test/jdk/javax/net/ssl/HttpsURLConnection/crisubn.jks)
 ⚠️ Patch contains a binary file (test/jdk/javax/net/ssl/HttpsURLConnection/trusted.jks)

Issue

  • JDK-8236073: G1: Use SoftMaxHeapSize to guide GC heuristics (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27524

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 26, 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 Sep 26, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title 8236073 8236073: G1: Use SoftMaxHeapSize to guide GC heuristics Sep 26, 2025
@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Sep 26, 2025
@openjdk
Copy link

openjdk bot commented Sep 26, 2025

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

  • hotspot

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.

@tschatzl
Copy link
Contributor Author

/label add hotspot-gc

@tschatzl
Copy link
Contributor Author

/label add jfr

@openjdk
Copy link

openjdk bot commented Sep 28, 2025

@tschatzl
The hotspot group label was already applied, so hotspot-gc label will not be added.

@openjdk
Copy link

openjdk bot commented Sep 28, 2025

@tschatzl
The label jfr is not a valid label.
These labels are valid:

  • graal
  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@tschatzl
Copy link
Contributor Author

/label add hotspot-jfr

@tschatzl
Copy link
Contributor Author

/label remove hotspot
/label add hotspot-gc hotspot-jfr

@openjdk
Copy link

openjdk bot commented Sep 28, 2025

@tschatzl
The hotspot group label was already applied, so hotspot-jfr label will not be added.

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label Sep 28, 2025
@openjdk
Copy link

openjdk bot commented Sep 28, 2025

@tschatzl
The hotspot label was successfully removed.

@openjdk openjdk bot added hotspot-gc hotspot-gc-dev@openjdk.org hotspot-jfr hotspot-jfr-dev@openjdk.org hotspot hotspot-dev@openjdk.org and removed hotspot-gc hotspot-gc-dev@openjdk.org hotspot-jfr hotspot-jfr-dev@openjdk.org labels Sep 28, 2025
@openjdk
Copy link

openjdk bot commented Sep 28, 2025

@tschatzl
The hotspot-gc label was successfully added.

The hotspot-jfr label was successfully added.

@tschatzl tschatzl marked this pull request as ready for review September 30, 2025 13:39
@openjdk openjdk bot added rfr Pull request is ready for review shenandoah shenandoah-dev@openjdk.org labels Sep 30, 2025
@openjdk
Copy link

openjdk bot commented Sep 30, 2025

@tschatzl shenandoah has been added to this pull request based on files touched in new commit(s).

@mlbridge
Copy link

mlbridge bot commented Sep 30, 2025

Webrevs

@tschatzl
Copy link
Contributor Author

/label remove shenandoah

@openjdk openjdk bot removed rfr Pull request is ready for review shenandoah shenandoah-dev@openjdk.org labels Sep 30, 2025
@openjdk
Copy link

openjdk bot commented Sep 30, 2025

@tschatzl
The shenandoah label was successfully removed.

@albertnetymk
Copy link
Member

/cc hotspot-gc

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Sep 30, 2025
@openjdk
Copy link

openjdk bot commented Sep 30, 2025

@albertnetymk
The hotspot-gc label was successfully added.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 30, 2025
@caoman
Copy link
Contributor

caoman commented Sep 30, 2025

Responding to @tschatzl's comment in https://bugs.openjdk.org/browse/JDK-8236073:

SoftMaxHeapSize just affects the target heap size for scheduling concurrent marks. GCTimeRatio sets the target as well, so the result is basically MIN(SoftMaxHeapSize, GCTimeRatio-based-target).

I have not verified, but could this problematic feedback loop happen?
User sets a low SoftMaxHeapSize value, then G1 starts to trigger more concurrent marks and incremental collections, then GC overhead becomes higher. Then G1 observes that the actual GC overhead is above the GCTimeRatio target, so it expands the heap. Thus, setting a small SoftMaxHeapSize makes G1 expand the heap further,

@tschatzl tschatzl marked this pull request as draft October 7, 2025 15:18
@openjdk openjdk bot removed the rfr Pull request is ready for review label Oct 7, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 3, 2025

@tschatzl This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@openjdk
Copy link

openjdk bot commented Dec 4, 2025

@tschatzl this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout submit/8236073-softmaxheapsize
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Dec 4, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Jan 28, 2026

@tschatzl This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org hotspot-gc hotspot-gc-dev@openjdk.org merge-conflict Pull request has merge conflict with target branch

Development

Successfully merging this pull request may close these issues.

3 participants