RFR: Expand old on demand [v42]

William Kemper wkemper at openjdk.org
Wed May 24 17:31:35 UTC 2023


On Mon, 8 May 2023 18:41:49 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> This PR describes several proposed changes to dynamically adjust the sizes of old-gen and young-gen.  In general, the objective is to keep old-gen as small as possible so that there is an abundance of memory available for the young-gen allocation runway.
>> 
>> This PR now passes all GHA pre-integration tests and other internal CI tests.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix whitespace

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

> 330: 
> 331: // Return conservative estimate of how much memory can be allocated before we need to start GC
> 332: size_t ShenandoahAdaptiveHeuristics::evac_slack(size_t young_regions_to_be_reclaimed) {

I don't understand the dimension of time or allocation rate in this function. The heuristic uses this formula to predict _when_ memory will be exhausted. If you just need to know how much memory is available, less any penalties are spike tolerance, then this could be much simpler.

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

> 558:                      proper_unit_for_byte_size(promo_in_place_potential));
> 559:         return true;
> 560:       } else if (mixed_candidates > 0) {

This will basically run mixed evacuations back to back until they're finished... is that what we want? It seems aggressive.

src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp line 411:

> 409:   if (_cannot_expand_trigger) {
> 410:     ShenandoahHeap* heap = ShenandoahHeap::heap();
> 411:     ShenandoahOldGeneration* old_gen = heap->old_generation();

This class holds a pointer to the old generation in `_old_generation` - can skip the `ShenandoahHeap::heap()->old_generation()` calls.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/248#discussion_r1191746601
PR Review Comment: https://git.openjdk.org/shenandoah/pull/248#discussion_r1191749729
PR Review Comment: https://git.openjdk.org/shenandoah/pull/248#discussion_r1191753809


More information about the shenandoah-dev mailing list