Skip to content

8382295: Shenandoah: wrong denominator in full gc summary #30755

Closed
rgithubli wants to merge 1 commit intoopenjdk:masterfrom
rgithubli:8382295
Closed

8382295: Shenandoah: wrong denominator in full gc summary #30755
rgithubli wants to merge 1 commit intoopenjdk:masterfrom
rgithubli:8382295

Conversation

@rgithubli
Copy link
Copy Markdown
Contributor

@rgithubli rgithubli commented Apr 15, 2026

When printing full gc summary, it prints out the percentage of explicit (System,gc()) and implicit GCs.

In the full GC section, its dominator is currently set to be concurrent GC count, which is wrong. The denominator should be the full gc count.

GHA passed.

Local testing: Run a simple app with two System.gc() calls. Before the change:

[6.077s][info][gc,stats       ]    15 Completed GCs
[6.077s][info][gc,stats       ]       2 caused by System.gc() (13.33%)
[6.077s][info][gc,stats       ]      13 caused by Concurrent GC (86.67%)
[6.077s][info][gc,stats       ] 
[6.077s][info][gc,stats       ]    13 Successful Concurrent GCs (86.67%)
[6.077s][info][gc,stats       ]      11 abbreviated (84.62%)
[6.077s][info][gc,stats       ] 
[6.077s][info][gc,stats       ]     0 Degenerated GCs (0.00%)
[6.077s][info][gc,stats       ]       0 upgraded to Full GC (0.00%)
[6.077s][info][gc,stats       ]       0 caused by allocation failure (0.00%)
[6.077s][info][gc,stats       ]       0 abbreviated (0.00%)
[6.077s][info][gc,stats       ] 
[6.077s][info][gc,stats       ]     2 Full GCs (13.33%)
[6.077s][info][gc,stats       ]       2 invoked explicitly (15.38%)
[6.077s][info][gc,stats       ]       0 invoked implicitly (0.00%)
[6.077s][info][gc,stats       ]       0 caused by allocation failure (0.00%)
[6.077s][info][gc,stats       ]       0 upgraded from Degenerated GC (0.00%)
[6.077s][info][gc,stats       ] 

After change:

[6.809s][info][gc,stats       ]    16 Completed GCs
[6.809s][info][gc,stats       ]       2 caused by System.gc() (12.50%)
[6.809s][info][gc,stats       ]      14 caused by Concurrent GC (87.50%)
[6.809s][info][gc,stats       ] 
[6.809s][info][gc,stats       ]    14 Successful Concurrent GCs (87.50%)
[6.809s][info][gc,stats       ]      12 abbreviated (85.71%)
[6.809s][info][gc,stats       ] 
[6.809s][info][gc,stats       ]     0 Degenerated GCs (0.00%)
[6.809s][info][gc,stats       ]       0 upgraded to Full GC (0.00%)
[6.809s][info][gc,stats       ]       0 caused by allocation failure (0.00%)
[6.809s][info][gc,stats       ]       0 abbreviated (0.00%)
[6.809s][info][gc,stats       ] 
[6.809s][info][gc,stats       ]     2 Full GCs (12.50%)
[6.809s][info][gc,stats       ]       2 invoked explicitly (100.00%)
[6.809s][info][gc,stats       ]       0 invoked implicitly (0.00%)
[6.809s][info][gc,stats       ]       0 caused by allocation failure (0.00%)
[6.809s][info][gc,stats       ]       0 upgraded from Degenerated GC (0.00%)
[6.809s][info][gc,stats       ] 





Progress

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

Issue

  • JDK-8382295: Shenandoah: wrong denominator in full gc summary (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30755

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@rgithubli rgithubli marked this pull request as ready for review April 15, 2026 20:06
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Apr 15, 2026

👋 Welcome back ruili! 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
Copy Markdown

openjdk Bot commented Apr 15, 2026

@rgithubli 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:

8382295: Shenandoah: wrong denominator in full gc summary

Reviewed-by: shade, kdnilsen

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 18 new commits pushed to the master branch:

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@shipilev, @kdnilsen) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk Bot added hotspot-gc hotspot-gc-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Apr 15, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 15, 2026

@rgithubli The following labels will be automatically applied to this pull request:

  • hotspot-gc
  • shenandoah

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

@openjdk openjdk Bot added the rfr Pull request is ready for review label Apr 15, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Apr 15, 2026

Webrevs

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 16, 2026

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-gc. This can be overridden with the /reviewers command.

Copy link
Copy Markdown
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

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

Looks correct.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Apr 16, 2026
@kdnilsen
Copy link
Copy Markdown
Contributor

One question: do we have to worry about _success_full_gcs equal zero causing a divide by zero?

@rgithubli
Copy link
Copy Markdown
Contributor Author

One question: do we have to worry about _success_full_gcs equal zero causing a divide by zero?

It's handled by percent_of: return denominator != 0 ? (double)numerator / (double)denominator * 100.0 : 0.0;

@rgithubli
Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk openjdk Bot added the sponsor Pull request is ready to be sponsored label Apr 16, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 16, 2026

@rgithubli
Your change (at version 7d9191d) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Copy Markdown
Member

/sponsor

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 17, 2026

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Apr 17, 2026
@openjdk openjdk Bot closed this Apr 17, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Apr 17, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 17, 2026

@shipilev @rgithubli Pushed as commit 2999731.

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

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 shenandoah shenandoah-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants