RFR: Usage tracking cleanup

William Kemper wkemper at openjdk.org
Tue Apr 18 22:06:34 UTC 2023


On Mon, 17 Apr 2023 23:59:07 GMT, Y. Srinivas Ramakrishna <ysr 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 719:
> 
>> 717: // * The sum of a generation's regions::used == generation::used
>> 718: // * The sum of a generation's humongous regions::free == generation::humongous_waste
>> 719: // These invariants are checked by the verifier on safepoints.
> 
> Which safepoints? (I presume not all, so better to be specific: may be "at safepoints for GC."

Sure, will do.

> src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 228:
> 
>> 226: public:
>> 227:   void increase_used(const ShenandoahAllocRequest& req);
>> 228:   void increase_used(size_t bytes);
> 
> Do we need both versions?

I would like to remove `increase_used(size_t bytes)` from `ShenandoahHeap` and use `ShenandoahGlobalGeneration` as the source of truth for "whole heap" metrics.

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

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


More information about the shenandoah-dev mailing list