RFR: 8312132: Add tracking of multiple address spaces in NMT [v105]

Johan Sjölen jsjolen at openjdk.org
Fri May 24 12:37:22 UTC 2024


On Fri, 24 May 2024 07:53:09 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Lower number of pages
>
> src/hotspot/share/nmt/memoryFileTracker.cpp line 66:
> 
>> 64:   stream->cr();
>> 65:   VMATree::TreapNode* prev = nullptr;
>> 66:   device->_tree.visit_in_order([&](VMATree::TreapNode* current) {
> 
> Does MemoryFileTracker really need to be friend to access the tree? It only needs read-only access to the tree, nothing else. Why not expose a ro access to the tree?
> 
> I balk at the many friend relationships. To my eye, they undermine the encapsulation. I can see the point for test classes, but here?

It's not a friend, only the test is. But I do agree, the general API w.r.t. encapsulation is a bit poorly defined right now. It's a bit difficult to nail the public vs private API whilst the code changes so frequently.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18289#discussion_r1613406858


More information about the hotspot-dev mailing list