RFR: 8373714: Shenandoah: Register heuristic penalties following a degenerated GC
William Kemper
wkemper at openjdk.org
Tue Dec 16 00:00:55 UTC 2025
On Mon, 15 Dec 2025 21:53:02 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
> Add a triggering penalty when we execute degenerated GC cycle.
We have to be careful not to revert: https://bugs.openjdk.org/browse/JDK-8368152.
src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp line 314:
> 312: ShenandoahCollectorPolicy* policy = heap->shenandoah_policy();
> 313: policy->record_degenerated(_generation->is_young(), _abbreviated, progress);
> 314: if (progress || (heap->mode()->is_generational() && !policy->generational_should_upgrade_degenerated_gc())) {
I'm not sure why we want to change the logic here. Previously, if there was no progress, and we were in generational mode and the policy said _not_ to upgrade to a full GC, nothing would happen here. Now we are treating that case the same as if there were progress, when there might not have been. `heap->notifiy_gc_progress()` resets the `no progress counter`, which has implications for how many times Shenandoah will retry allocations. We need to be careful to avoid an allocation loop that just runs degenerated cycles forever (brownout).
-------------
Changes requested by wkemper (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28834#pullrequestreview-3580616145
PR Review Comment: https://git.openjdk.org/jdk/pull/28834#discussion_r2621222637
More information about the hotspot-gc-dev
mailing list