Skip to content

8381550: Shenandoah: Fix confusing end of degenerated cycle log message #30684

Open
pf0n wants to merge 1 commit intoopenjdk:masterfrom
pf0n:8381550
Open

8381550: Shenandoah: Fix confusing end of degenerated cycle log message #30684
pf0n wants to merge 1 commit intoopenjdk:masterfrom
pf0n:8381550

Conversation

@pf0n
Copy link
Copy Markdown

@pf0n pf0n commented Apr 10, 2026

A degenerated global cycle in Generational Shenandoah will show up as a Degenerated Young GC instead of a Degenerated Global GC in the gc logs. Changed the hardcoded message by using the generation type of the gc to distinguish between a young and global gc.

Before change:

[0.314s][info][gc,start    ] GC(1) Pause Degenerated GC (Global) (Update Refs)
[0.314s][info][gc,task     ] GC(1) Using 16 of 16 workers for stw degenerated gc
[0.316s][info][gc,free     ] Whole heap stats: Total free: 237M, Total used: 128K, Max free in a single region: 256K, Max humongous: 236M; Frag stats: External: 1%, Internal: 0%;  Mutator freeset stats: Partition count: 952, Reserved: 237M, Max free available in a single region: 256K; Collector freeset stats: Partition count: 52, Reserved: 13247K, Max free available in a single region: 256K; OldCollector freeset stats: Partition count: 2, Reserved: 512K, Max free available in a single region: 256K;
[0.316s][info][gc,plab     ] GC(1) Cycle complete, promotions reserved: 273196, promotions expended: 0, failed count: 0, failed bytes: 0
[0.316s][info][gc,ergo     ] GC(1) Good progress for free space: 237M, need 2621K
[0.316s][info][gc,ergo     ] GC(1) Good progress for used space: 768K, need 256K
[0.316s][info][gc          ] GC(1) Pause Degenerated GC (Global) (Update Refs) 5M->4M(256M) 1.976ms
[0.316s][info][gc,ergo     ] GC(1) At end of Degenerated Young GC: GCU: 0.4%, MU: 4.4% during period of 0.316s
[0.316s][info][gc,ergo     ] GC(1) At end of Degenerated Young GC: Young generation used: 4800K, used regions: 5120K, humongous waste: 255K, soft capacity: 256M, max capacity: 255M, available: 237M
[0.316s][info][gc,ergo     ] GC(1) At end of Degenerated Young GC: Old generation used: 0B, used regions: 0B, humongous waste: 0B, soft capacity: 256M, max capacity: 512K, available: 512K

After change:

[0.310s][info][gc,start    ] GC(1) Pause Degenerated GC (Global) (Update Refs)
[0.310s][info][gc,task     ] GC(1) Using 16 of 16 workers for stw degenerated gc
[0.312s][info][gc,free     ] Whole heap stats: Total free: 238M, Total used: 65488B, Max free in a single region: 256K, Max humongous: 237M; Frag stats: External: 1%, Internal: 0%;  Mutator freeset stats: Partition count: 954, Reserved: 238M, Max free available in a single region: 256K; Collector freeset stats: Partition count: 52, Reserved: 13312K, Max free available in a single region: 256K; OldCollector freeset stats: Partition count: 1, Reserved: 256K, Max free available in a single region: 256K;
[0.312s][info][gc,plab     ] GC(1) Cycle complete, promotions reserved: 195187, promotions expended: 0, failed count: 0, failed bytes: 0
[0.312s][info][gc,ergo     ] GC(1) Good progress for free space: 238M, need 2621K
[0.312s][info][gc,ergo     ] GC(1) Good progress for used space: 768K, need 256K
[0.312s][info][gc          ] GC(1) Pause Degenerated GC (Global) (Update Refs) 5M->4M(256M) 1.639ms
[0.312s][info][gc,ergo     ] GC(1) At end of Degenerated Global GC: GCU: 0.3%, MU: 4.4% during period of 0.312s
[0.312s][info][gc,ergo     ] GC(1) At end of Degenerated Global GC: Young generation used: 4415K, used regions: 4608K, humongous waste: 255K, soft capacity: 256M, max capacity: 255M, available: 238M
[0.312s][info][gc,ergo     ] GC(1) At end of Degenerated Global GC: Old generation used: 0B, used regions: 0B, humongous waste: 0B, soft capacity: 256M, max capacity: 256K, available: 256K

Tested with GHA, local tier 1 tests, and created a test that produces a degenerated global cycle (did not push this per @earthling-amzn).



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-8381550: Shenandoah: Fix confusing end of degenerated cycle log message (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30684

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 10, 2026

👋 Welcome back pf0n! 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 10, 2026

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

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

openjdk bot commented Apr 10, 2026

@pf0n 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 10, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 10, 2026

Webrevs

Copy link
Copy Markdown
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 think you may be able to refactor and common up some of the label generation (pun not intended) to reduce some of the repetition?

Looks good otherwise.

heap->mmu_tracker()->record_degenerated(GCId::current(), is_bootstrap_gc);
const char* msg = is_bootstrap_gc? "At end of Degenerated Bootstrap Old GC": "At end of Degenerated Young GC";
const ShenandoahGenerationType generation_type = _generation->type();
heap->mmu_tracker()->record_degenerated(GCId::current(), is_bootstrap_gc, generation_type);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice if we didn't need to duplicate this switch logic to compute what is essentially the same value, but I can't see a way around it that wouldn't turn into a huge refactor.

Copy link
Copy Markdown
Author

@pf0n pf0n Apr 10, 2026

Choose a reason for hiding this comment

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

Yeah I initially didn't want the repetitive logic of the switch statements, but I noticed that the method record_degenerated calls ShenandoahMmuTracker::update_utilization which has the prefix At end of, while log_heap_status doesn't, so I can't pass in the same value for the record_degenerated method to avoid the repetition.

@earthling-amzn
Copy link
Copy Markdown
Contributor

Can we also fix this from shenandoahGenerationalControlThread.cpp:

msg = "At end of Interrupted Concurrent GLOBAL GC";

It shouldn't be yelling about GLOBAL GCs.

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

Development

Successfully merging this pull request may close these issues.

3 participants