RFR: Usage tracking cleanup

Kelvin Nilsen kdnilsen at openjdk.org
Mon Apr 17 23:30:15 UTC 2023


On Mon, 17 Apr 2023 23:23:28 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> There are many nuances to tracing memory utilization. Shenandoah track's usage, waste by humongous objects, padding for promotion LABs alignment and all this is also tracked by generation, the heap and feeds into the heuristics and the pacer. The code to update all of these values and route them to the right places was spread across the allocation call stack. This change consolidates all of the logic into one method, invoked near the end of the allocation.
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 732:
> 
>> 730: // * There are three sources of waste:
>> 731: //  * The padding used to align a PLAB on card size
>> 732: //  * Region's free is less than minimum TLAB size and is retired
> 
> I think there are two notions "retirement" in existing code.  There is a temporary retirement that applies only until we rebuild the free set (at end of this gc, or start of next evac).  And there is a permanent retirement that places a fill object into the remnant of free memory so that the memory is no longer free.  (maybe this distinction is not on the master branch.)  The permanent retirement lasts until this region is collected.  The accounting is different.  In both cases, we increase ShenandoahFreeSet::used.  In the permanent case, we also increase the relevant generation:used.

I'm not sure that we really need both approaches.  The rationale for permanent retirement is that we don't want to repeatedly discover and re-retire old-gen regions that are scattered throughout the heap.  This is less of a problem with young-gen regions, because regions that are retired once will either soon be promoted or they will be collected.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/260#discussion_r1169349359


More information about the shenandoah-dev mailing list