RFR: 8312132: Add tracking of multiple address spaces in NMT [v49]
Johan Sjölen
jsjolen at openjdk.org
Tue May 28 13:18:19 UTC 2024
On Fri, 26 Apr 2024 17:42:52 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:
>> We could invert the relationship such that the outer class is the `AllStatic` class and the inner class is the allocatable class. I'll look into it at a later stage as it's all a big renaming.
>>
>> Personally, I don't mind the `::Instance` nomenclature to indicate that "this is the global instance that we're accessing". As long as we keep away from static, global singletons that we can't make many instances like VirtualMemoryTracker and MallocTracker are written, I'm a happy goose.
>
> I agree with you actually, but the `Instance` jumps out at me and makes me wonder why we decided to use it, compared to the others, that are happy to be static classes.
>
> We should have it all done same way. If you like to use `Instance`, then `VirtualMemoryTracker` and `MallocTracker` should use one as well (at some point later).
I'm taking this to mean that we can later transition to the `Instance` pattern in the future for the rest of the classes, which I do think is the right way to go. Static classes generally make our code more difficult to test.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1617227778
More information about the hotspot-dev
mailing list