RFR: 8368152: Shenandoah: Incorrect behavior at end of degenerated cycle [v2]

Kelvin Nilsen kdnilsen at openjdk.org
Tue Sep 23 21:13:28 UTC 2025


On Tue, 23 Sep 2025 21:10:11 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> There are several issues addressed in this PR:
>> * Shenandoah always ran a full GC after any degenerated cycle
>> * The number of consecutive degenerated GCs with bad progress was reset for every degenerated cycle
>> * Good progress was reported in generational mode even when no progress is made
>
> William Kemper has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix typo in comment

A common scenario that I have seen in various GC logs is the following:
1. Concurrent GC experiences allocation failure and degenerates
2. Degenerated GC fails to make progress because lots of garbage was allocated after the start of concurrent marking (ie. all garbage is floating)
3. We escalate to Full GC, resulting in a very long STW delay (The Full GC delay plus the delay for degen that preceded Full GC)
4. It is often the case that better throughput and better latency is realized if we run a concurrent GC which may once again degenerate, rather than escalating from the first degen to Full GC. All of the floating garbage that was locked up during the previous GC should be reclaimed by the second concurrent (possibly degenerated) GC, so the second cycle should have "good progress" even if the first did not.
5. I believe the solution you've implemented here will first try a second concurrent/degenerated cycle before escalating to Full GC.  Will you confirm that?

Should we have some comments in this code to explain why CONSECUTIVE_BAD_DEGEN_PROGRESS_THRESHOLD is 2 and not 1?

-------------

Marked as reviewed by kdnilsen (Committer).

PR Review: https://git.openjdk.org/jdk/pull/27456#pullrequestreview-3259587644


More information about the hotspot-gc-dev mailing list