RFR: Use peak occupancy to optimize/pessimize free_threshold in adaptive heuristics

Roman Kennke roman at kennke.org
Thu May 4 17:38:03 UTC 2017


Am 04.05.2017 um 19:31 schrieb Aleksey Shipilev:
> On 05/04/2017 07:17 PM, Roman Kennke wrote:
>> That means, observe the peak occupancy (right before
>> reclamation) and pessimize if peak occupancy is less than a threshold.
>> Here I'm re-using ShenandoahMinFreeThreshold for this. This should
>> balance our GC cycles around that threshold and leave some room for
>> alloc spikes, thus leading to fewer degen cycles or full-gcs.
>>
>> http://cr.openjdk.java.net/~rkennke/adaptive-minfree/webrev.00/
> Good stuff, I have zero degens on Compiler.compiler now.
>
> I think the capturing is slightly wrong though: it records occupancy at final
> mark and before update-refs, overwriting the value. Which means if update-refs
> managed to clean up enough (as they do), we may be blind about the case when
> there is not enough space right after the mark. That would not be visible on
> workloads where there is enough immediate garbage reclaimed after mark.
>
> I think we need to store MAX of observed occupancies, and reset it to zero when
> we claim it in heuristics.
Maybe.
Currently we're simply always looking at the last heap occupancy, right
before reclamation, and right before we would query it. Notice that we
do adjust the free-threshold both after marking and after UR.

E.g.:
final-mark:
record-peak-occupancy
reclaim-regions
check for optimize/pessimize

final-update-refs:
record-peak-occupancy
reclaim-regions
check for optimize/pessimize

Is that not ok? For the start? ;-)




More information about the shenandoah-dev mailing list