RFR: Adaptive heuristic should take reserved memory into account

Y. S. Ramakrishna duke at openjdk.org
Mon Jun 27 22:46:18 UTC 2022


On Mon, 27 Jun 2022 21:24:06 GMT, William Kemper <wkemper at openjdk.org> wrote:

> Before this change, the heuristic considered the memory available to both the collector and mutators. Since the collector memory is not available to mutators, they may experience an allocation failure before the heuristic could anticipate. With this change, the heuristic looks at the memory available to mutators only. This has the effect of making the heuristic tend to start cycles earlier, thus avoiding degenerated cycles.

src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 248:

> 246:   //   2. Accumulated penalties from Degenerated and Full GC
> 247:   size_t allocation_headroom = available;
> 248:   size_t spike_headroom = capacity / 100 * ShenandoahAllocSpikeFactor;

Should you move the associated comments at lines 281-324 up here as well. The comment further below now dangles on its own.

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

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


More information about the shenandoah-dev mailing list