RFR: Allow heuristic trigger to increase capacity instead of running a collection

William Kemper wkemper at openjdk.org
Wed Jan 4 22:29:27 UTC 2023


On Wed, 4 Jan 2023 16:56:54 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Before the adaptive heuristic starts a collection, it will attempt to increase the capacity of its generation. If the capacity is increased, the heuristic will re-evaluate the trigger criteria.
>> 
>> There is also a change here to attempt to increase the size of the old generation in response to a promotion failure.
>
> The changes look ok.
> 
> I did wonder though if one might (for odd situations) reduce the number of recursions through `should_start_gc()` by having some notion of error that we are trying to correct when we call `resize_and_and_evaluate(/* pass in error or size differential here */)` from `should_start_gc()`. Anyway, just a thought for you to think about.
> 
> Reviewed!

@ysramakrishna - changing the capacity of a generation will reset the `_gc_times_learned` field of the heuristics to zero. `resize_and_evaluate` will only resize (and recursive) if `_gc_times_learned` is not less than `ShenandoahLearningSteps`, so it will only really attempt to resize the generation once every `ShenandoahLearningSteps` number of cycles.

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

PR: https://git.openjdk.org/shenandoah/pull/190


More information about the shenandoah-dev mailing list