8350889: GenShen: Break out of infinite loop of old GC cycles

Reviewed-by: wkemper, ysr
This commit is contained in:
Kelvin Nilsen 2025-02-27 23:23:40 +00:00
parent 0a4c5a8a48
commit ab4b0ef924
2 changed files with 2 additions and 0 deletions

View File

@ -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;
}

View File

@ -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();