RFR: Usage tracking cleanup
Kelvin Nilsen
kdnilsen at openjdk.org
Mon Apr 17 23:30:15 UTC 2023
On Mon, 17 Apr 2023 22:33:05 GMT, William Kemper <wkemper 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.
This looks like a good improvement. Thanks for sorting through these details. I assume we pass all the existing GenShen regression tests.
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.
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 757:
> 755: if (wasted_bytes > 0) {
> 756: if (req.actual_size() > ShenandoahHeapRegion::humongous_threshold_words()) {
> 757: // generation->increase_humongous_waste(wasted_bytes);
why is this commented out?
-------------
Marked as reviewed by kdnilsen (Committer).
PR Review: https://git.openjdk.org/shenandoah/pull/260#pullrequestreview-1389063286
PR Review Comment: https://git.openjdk.org/shenandoah/pull/260#discussion_r1169348249
PR Review Comment: https://git.openjdk.org/shenandoah/pull/260#discussion_r1169346245
More information about the shenandoah-dev
mailing list