From ab4b0ef9242a4cd964fbcf2d1f3d370234c09408 Mon Sep 17 00:00:00 2001 From: Kelvin Nilsen Date: Thu, 27 Feb 2025 23:23:40 +0000 Subject: [PATCH] 8350889: GenShen: Break out of infinite loop of old GC cycles Reviewed-by: wkemper, ysr --- .../gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp | 1 + src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp index 7a624d4d4a4..5280e9b2ac4 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp @@ -241,6 +241,7 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() { ", allocated: %zu", available, capacity, allocated); if (_start_gc_is_pending) { + log_trigger("GC start is already pending"); return true; } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp index a684e8ff228..752ad743520 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRegulatorThread.cpp @@ -74,6 +74,7 @@ void ShenandoahRegulatorThread::regulate_young_and_old_cycles() { if (start_old_cycle()) { log_debug(gc)("Heuristics request for old collection accepted"); _young_heuristics->cancel_trigger_request(); + _old_heuristics->cancel_trigger_request(); } else if (request_concurrent_gc(YOUNG)) { log_debug(gc)("Heuristics request for young collection accepted"); _young_heuristics->cancel_trigger_request();