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

Y. Srinivas Ramakrishna ysr at openjdk.org
Tue Sep 23 22:05:29 UTC 2025


On Tue, 23 Sep 2025 21:31:40 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> William Kemper has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Improve comment
>
> src/hotspot/share/gc/shenandoah/shenandoahCollectorPolicy.hpp line 68:
> 
>> 66:   // in generational mode, run a full GC. Non-generational modes will upgrade
>> 67:   // immediately when a degenerated cycle does not make progress. Many degenerated
>> 68:   // cycles are caused by floating garbage. It is more efficient to attempt
> 
> If it's used only for generational case, I'd like the comment to be less coy about it. I'd place `GENERATIONAL` or some such in the name of the constant, e.g. `GENERATIONAL_TO_FULL_NON_PROGRESSING_DEGENS`,  and its "accessor" (or user) down in `should_upgrade_degenerated_gc()` to, e.g., `generational_should_upgrade_degen_to_full()`.
> 
> The comment could say:
> 
> 
> // When a degenerated cycle doesn't make progress:
> // a. for the non-generational case, we'll immediately upgrade to full at the first non-progressing degen
> // b. for the generational case, we'll upgrade to full after these many non-progressing consecutive degens
> 
> 
> My question is why we choose this number for genshen. May be a sentence in the ticket or in the comments on the intuition here?

Noticed the long comment at lines 313-323 in `ShenandoahDegenGC::collect()` that describes why. May be move that comment (made suitably more succinct) to this place also to tie it all together in one place.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27456#discussion_r2373551052


More information about the hotspot-gc-dev mailing list