RFR: 8311978: Create abstraction over heap metrics for heuristics [v3]

William Kemper wkemper at openjdk.org
Mon Jul 17 16:34:23 UTC 2023


On Fri, 14 Jul 2023 01:15:23 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> William Kemper has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Put explicit constructor call back in
>
> src/hotspot/share/gc/shenandoah/mode/shenandoahSATBMode.cpp line 66:
> 
>> 64:     return new ShenandoahAdaptiveHeuristics(ShenandoahHeap::heap());
>> 65:   } else if (strcmp(ShenandoahGCHeuristics, "compact") == 0) {
>> 66:     return new ShenandoahCompactHeuristics();
> 
> It feels a bit ad-hoc to me that ShenandoahStaticHeuristic & ShenandoahCompactHeuristic, which both use some information about the state of the heap (i.e. state queriable through ShenandoahHeapStats interface methods), don't get passed that argument in the constructor. I'd ideally like to see the c'tors changed to hew to the same pattern rather than their reaching directly into the global heap object to get what they need.
> 
> A question to ask is, if a new heuristic were to be designed in the future, would it extend ShenandahHeapStats, being the official interface through which heuristics make use of properties of the heap upon which they operate to extract that information?

Okay, I'll make that change.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14856#discussion_r1265616989


More information about the hotspot-gc-dev mailing list