RFR: Performance improvements for non-generational modes
William Kemper
wkemper at openjdk.org
Mon Mar 6 22:03:01 UTC 2023
On Mon, 6 Mar 2023 19:34:54 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:
>> There are a basket of changes here:
>> * Make heuristics a bit less aggressive:
>> * Revert threshold triggers to use `available` rather than adjusted head room.
>> * Remove code that adjusted average gc time, it was causing wild fluctuations and making heuristic behave erratically
>> * Skip over more generational mode constraints on the allocation path
>> * Disable `ShenadoahEvacLABRatio` by default as it causes unused bytes in survivors regions, which in turn leads to these regions to being included in the mutator view of free memory. This contributed to higher fragmentation rates.
>> * More detailed debugging messages under the `gc+free` tags.
>
> src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 371:
>
>> 369: size_t min_threshold = min_free_threshold();
>> 370:
>> 371: if (available < min_threshold) {
>
> In general the changes to this method look somewhat ad-hoc to me. Is the intention to continue using `allocation_headroom` in the future, and this was a "quick-and-dirty" fix? The discrepancy between decision-flow and logging can create confusion.
>
> I see that the calculated `allocation_headroom` is being used further down (line 448) for control-flow. If possible, I'd define it closer to where it's going to be used, and move the related comments as well so that readers of this code & the comments above will not end up confused.
This is essentially reverting a change we made to have the `free` and `learning` triggers use the adjusted head room.
> src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 374:
>
>> 372: log_info(gc)("Trigger (%s): Free (" SIZE_FORMAT "%s) is below minimum threshold (" SIZE_FORMAT "%s)",
>> 373: _generation->name(),
>> 374: byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
>
> shouldn't this be `available` instead of `allocation_headroom` in the logs?
Using `available` here is as the code is on `openjdk/jdk:master`.
-------------
PR: https://git.openjdk.org/shenandoah/pull/220
More information about the shenandoah-dev
mailing list