RFR: 8321816: GenShen: Provide a minimum amount of time for an old collection to run [v4]
Y. Srinivas Ramakrishna
ysr at openjdk.org
Thu Dec 21 21:16:15 UTC 2023
On Thu, 21 Dec 2023 03:23:36 GMT, William Kemper <wkemper at openjdk.org> wrote:
>> When regulating young and old cycles (i.e., generational mode), the regulator overrides the global heuristics decision to start a global cycle. In other modes, whether or not to unload classes is decided _after_ a cycle is started. However, the generational mode can only unload classes in a _global_ cycle, so we use the oom in metaspace to _trigger_ a global cycle (even if the global heuristic would not otherwise trigger a cycle).
>>
>> The other subtlety here is that old cycles are only started when a young cycle wants to run. Each old cycle is preceded by a young "bootstrap" cycle, so the young heuristic trigger is still satisfied. This was meant to avoid the situation where old cycles are triggered shortly after a young cycle - which runs an unproductive "bootstrap" cycle. This is why we check the young heuristic and then the old heuristic before starting an old cycle.
>>
>> Your comment about starting a global cycle (to unload classes) even during an old cycle is interesting though. There's no specific reason why we couldn't interrupt and abandon the old cycle in this case, but I think that's a change for another PR.
>
> I'm not too worried about the regulator's sleep method. The new flag introduces a delay if an old cycle is running, but the delay to start a young cycle because the regulator thread was sleeping is unchanged. Note that the feature can also be disabled by setting `ShenandoahMinimumOldMarkTimeMs` to zero.
Thanks for the clarifications here and for the extra documentation comments. Yes, I'd missed the subtleties here, which are important to document. Thanks for that!
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/371#discussion_r1434517984
More information about the shenandoah-dev
mailing list