RFR: 8343893: Test jdk/jfr/event/runtime/TestNativeMemoryUsageEvents.java failed: heap should have grown and NMT should show that: expected 0 > 0 [v4]

Johan Sjölen jsjolen at openjdk.org
Wed Nov 20 08:42:19 UTC 2024


On Tue, 19 Nov 2024 16:48:28 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> src/hotspot/share/nmt/nmtUsage.cpp line 105:
>> 
>>> 103:       _vm_total.committed += vm->committed();
>>> 104:     });
>>> 105:   }
>> 
>> I am missing something here, in memoryFileTracker.hpp you say:
>> 
>> 
>> // All memory is accounted as committed, there is no reserved memory.
>> // Any reserved memory is expected to exist in the VirtualMemoryTracker.
>> 
>> 
>> but here we use MFT to account for both reserved and committed?
>
> Ah, we actually do use VirtualMemory here to track the memory. Never mind!

Yeah, but it is actually 0 :). I wanted to future proof this code, if we ever do use `reserved` here. I'll assert that `reserved` is 0 with a good message, then we can fix the code if our assumptions change.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22204#discussion_r1849851012


More information about the hotspot-jfr-dev mailing list