RFR: 8255984: Shenandoah: "adaptive" heuristic is prone to missing load spikes [v2]

earthling-amzn github.com+71722661+earthling-amzn at openjdk.java.net
Fri Nov 13 18:49:58 UTC 2020


On Fri, 13 Nov 2020 17:05:46 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> earthling-amzn has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Remove const qualifier from should_start_gc
>>    
>>    This lets the heuristics update state without const_casts.
>>  - Rename ShenandoahReactive flags to ShenandoahAdaptive flags.
>
> src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 367:
> 
>> 365:   _last_sample_time = os::javaTimeNanos();
>> 366:   _last_sample_value = 0;
>> 367: }
> 
> This method seems unused.

Oops, good catch. This was meant to be called from `record_cycle_start`, lost it when I merged reactive into adaptive. Will push the fix soon.

> src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp line 383:
> 
>> 381: 
>> 382: double ShenandoahAllocationRate::instantaneous_rate(size_t bytes_allocated_since_gc_start) const {
>> 383:   size_t allocation_delta = bytes_allocated_since_gc_start - _last_sample_value;
> 
> `allocation_delta` underflows here in my benchmarks, causing back-to-back "Instantaneous rate" triggers. Note that `sample()` method seems to check for it.

Yep, that's because I fumbled the `allocation_counter_reset` call.

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

PR: https://git.openjdk.java.net/jdk/pull/1099



More information about the hotspot-gc-dev mailing list