Skip to content

8364081: Shenandoah & GenShen logging improvement #26469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rgithubli
Copy link
Contributor

@rgithubli rgithubli commented Jul 25, 2025

Fix missing increment_total_collections usages in Shenandoah (otherwise, the invocation count is always 0 as shown in #26272 overview).

Also added some generational information for generational shenandoah logging.

Shenandoah logging samples:

######################
Shenandoah - Beore GC
######################
[0.161s][debug][gc,heap      ] GC(0) Heap Before GC invocations=0 (full 0):
[0.161s][debug][gc,heap      ] GC(0)  Shenandoah Heap
[0.161s][debug][gc,heap      ] GC(0)    100M max, 100M soft max, 100M committed, 40312K used
[0.161s][debug][gc,heap      ] GC(0)   400 x 256K regions
[0.161s][debug][gc,heap      ] GC(0)  Status: not cancelled
[0.161s][debug][gc,heap      ] GC(0)  Reserved region:
[0.161s][debug][gc,heap      ] GC(0)   - [0x00000000f9c00000, 0x0000000100000000) 
[0.161s][debug][gc,heap      ] GC(0)  Collection set:
[0.161s][debug][gc,heap      ] GC(0)   - map (vanilla): 0x0000000000004e70
[0.161s][debug][gc,heap      ] GC(0)   - map (biased):  0x0000000000001000
[0.161s][debug][gc,heap      ] GC(0) 
[0.161s][debug][gc,metaspace ] GC(0) Metaspace Before GC invocations=0 (full 0):
[0.161s][debug][gc,metaspace ] GC(0)  Metaspace       used 86K, committed 320K, reserved 1114112K
[0.161s][debug][gc,metaspace ] GC(0)   class space    used 3K, committed 128K, reserved 1048576K

######################
Shenandoah - After GC
######################
[2.179s][debug][gc,heap        ] GC(9) Heap After GC invocations=17 (full 7):
[2.179s][debug][gc,heap        ] GC(9)  Shenandoah Heap
[2.179s][debug][gc,heap        ] GC(9)    100M max, 100M soft max, 100M committed, 97113K used
[2.179s][debug][gc,heap        ] GC(9)   400 x 256K regions
[2.179s][debug][gc,heap        ] GC(9)  Status: not cancelled
[2.179s][debug][gc,heap        ] GC(9)  Reserved region:
[2.179s][debug][gc,heap        ] GC(9)   - [0x00000000f9c00000, 0x0000000100000000) 
[2.179s][debug][gc,heap        ] GC(9)  Collection set:
[2.179s][debug][gc,heap        ] GC(9)   - map (vanilla): 0x0000000000004e70
[2.179s][debug][gc,heap        ] GC(9)   - map (biased):  0x0000000000001000
[2.179s][debug][gc,heap        ] GC(9) 
[2.179s][debug][gc,metaspace   ] GC(9) Metaspace After GC invocations=17 (full 7):
[2.179s][debug][gc,metaspace   ] GC(9)  Metaspace       used 125K, committed 320K, reserved 1114112K
[2.179s][debug][gc,metaspace   ] GC(9)   class space    used 4K, committed 128K, reserved 1048576K

Generational Shenandoah logging samples

######################
Generational Shenandoah - Beore GC
######################
[0.212s][debug][gc,heap      ] GC(0) Heap Before GC invocations=0 (full 0):
[0.212s][debug][gc,heap      ] GC(0)  Generational Shenandoah Heap
[0.212s][debug][gc,heap      ] GC(0)   Young:
[0.212s][debug][gc,heap      ] GC(0)    100M max, 39686K used
[0.212s][debug][gc,heap      ] GC(0)   Old:
[0.212s][debug][gc,heap      ] GC(0)    0B max, 0B used
[0.212s][debug][gc,heap      ] GC(0)   Entire heap:
[0.212s][debug][gc,heap      ] GC(0)    100M soft max, 100M committed
[0.212s][debug][gc,heap      ] GC(0)  Status: not cancelled
[0.212s][debug][gc,heap      ] GC(0)  Reserved region:
[0.212s][debug][gc,heap      ] GC(0)   - [0x00000000f9c00000, 0x0000000100000000) 
[0.212s][debug][gc,heap      ] GC(0)  Collection set:
[0.212s][debug][gc,heap      ] GC(0)   - map (vanilla): 0x0000000000004e70
[0.212s][debug][gc,heap      ] GC(0)   - map (biased):  0x0000000000001000
[0.212s][debug][gc,heap      ] GC(0) 
[0.212s][debug][gc,metaspace ] GC(0) Metaspace Before GC invocations=0 (full 0):
[0.212s][debug][gc,metaspace ] GC(0)  Metaspace       used 153K, committed 384K, reserved 1114112K
[0.212s][debug][gc,metaspace ] GC(0)   class space    used 3K, committed 128K, reserved 1048576K

######################
Generational Shenandoah - After GC
######################
[1.752s][debug][gc,heap        ] GC(18) Heap After GC invocations=19 (full 3):
[1.752s][debug][gc,heap        ] GC(18)  Generational Shenandoah Heap
[1.752s][debug][gc,heap        ] GC(18)   Young:
[1.752s][debug][gc,heap        ] GC(18)    3328K max, 2883K used
[1.752s][debug][gc,heap        ] GC(18)   Old:
[1.752s][debug][gc,heap        ] GC(18)    99072K max, 98060K used
[1.752s][debug][gc,heap        ] GC(18)   Entire heap:
[1.752s][debug][gc,heap        ] GC(18)    100M soft max, 100M committed
[1.752s][debug][gc,heap        ] GC(18)  Status: young marking, cancelled
[1.752s][debug][gc,heap        ] GC(18)  Reserved region:
[1.752s][debug][gc,heap        ] GC(18)   - [0x00000000f9c00000, 0x0000000100000000) 
[1.752s][debug][gc,heap        ] GC(18)  Collection set:
[1.752s][debug][gc,heap        ] GC(18)   - map (vanilla): 0x0000000000004e70
[1.752s][debug][gc,heap        ] GC(18)   - map (biased):  0x0000000000001000
[1.752s][debug][gc,heap        ] GC(18) 
[1.752s][debug][gc,metaspace   ] GC(18) Metaspace After GC invocations=19 (full 3):
[1.752s][debug][gc,metaspace   ] GC(18)  Metaspace       used 209K, committed 448K, reserved 1114112K
[1.752s][debug][gc,metaspace   ] GC(18)   class space    used 7K, committed 128K, reserved 1048576K

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-8364081: Shenandoah & GenShen logging improvement (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26469

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 25, 2025

👋 Welcome back rgithubli! 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 Jul 25, 2025

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

8364081: Shenandoah & GenShen logging improvement

Reviewed-by: wkemper

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 10 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 (@earthling-amzn) 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
Copy link

openjdk bot commented Jul 25, 2025

@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 hotspot-gc hotspot-gc-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Jul 25, 2025
@rgithubli rgithubli marked this pull request as ready for review July 25, 2025 14:08
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 25, 2025
@mlbridge
Copy link

mlbridge bot commented Jul 25, 2025

Webrevs

@openjdk
Copy link

openjdk bot commented Jul 25, 2025

@rgithubli Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

Copy link
Contributor

@earthling-amzn earthling-amzn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for fixing this.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 25, 2025
Copy link
Member

@ysramakrishna ysramakrishna left a comment

Choose a reason for hiding this comment

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

I am wondering if we could just hoist the incrementing of the collections count to run_gc_cycle() which would normally take care of everything at once in one place, with the option true for stw and full cases.

It would probably miss the upgrade to full at a degen. We could either overcount by incrementing at the point of upgrade to full or gloss over it. I'd do the former (which is what I believe your degen upgrade to full does here).

(The other, perhaps arguably (or subjectively) better semantics, for full in the case of concurrent collectors is to conflate degens with full, treating both as a kind of failure of concurrent mode.

The problem is that the "total collections & full collections" terminology is inadequate when we have concurrent gcs, both young & old, global (explicit system.gc() invoking a concurrent gobal), and concurrent mode failures (degens) of each kind of collection. So I am guessing at some point we'll need to expand this semantics smoothly to accommodate these other kinds of collection.

However, this can be done later as an RFE that smoothly integrates what JFR et al. do as well.)

num_regions(),
byte_size_in_proper_unit(ShenandoahHeapRegion::region_size_bytes()),
proper_unit_for_byte_size(ShenandoahHeapRegion::region_size_bytes()));
bool is_generational = mode()->is_generational();
Copy link
Member

Choose a reason for hiding this comment

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

const

Comment on lines +600 to +602
st->print_cr(" %zu x " PROPERFMT " regions",
num_regions(),
PROPERFMTARGS(ShenandoahHeapRegion::region_size_bytes()));
Copy link
Member

Choose a reason for hiding this comment

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

I'd print this info for GenShen above as well.

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 ready Pull request is ready to be integrated rfr Pull request is ready for review shenandoah shenandoah-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants