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

Y. Srinivas Ramakrishna ysr at openjdk.org
Thu Feb 27 17:35:03 UTC 2025


On Thu, 27 Feb 2025 17:28:07 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 246:
>> 
>>> 244:     log_trigger("GC start is already pending");
>>> 245:     return true;
>>> 246:   }
>> 
>> Should this happen lower down? Otherwise you miss the sampling of allocation rate at this time, down at line 249. Not sure if that can be an issue. Perhaps not and you just interpolate an average over the duration since the last sample albeit missing the occasional spike or dip, with perhaps the resulting low-pass filtering here ok? It would be OK if there is not an expectation of roughly syncrhonous sampling. Depends on how the code at line 286 works, I guess.
>
> PS: the lvalue rate at line 249 isn't used anywhere. Does the compiler complain if you `sample` without assigning the value?

Looked at the code for `ShenandoahAllocationRate`, I guess this may have the effect of making the sampling a bit more asynchronous, but the resulting smoothing over the interval could underestimate the volatility of the rate which is used in an `upper_bound` calculation below. May be that is harmless?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23827#discussion_r1974048690


More information about the shenandoah-dev mailing list