RFR: 8334234: NMT: Re-evaluate MallocMemory and VirtualMemory counter classes

Robert Toyonaga duke at openjdk.org
Tue Sep 10 14:10:04 UTC 2024


On Mon, 12 Aug 2024 14:01:29 GMT, Robert Toyonaga <duke at openjdk.org> wrote:

> ### Summary
> This PR splits up NMT memory counter classes into "live" and "flat" versions. Currently, the same classes are used and reused in both live (recording) and snapshotted (reporting) contexts.  However, after counters have been shapshotted, they no longer need to be atomic or require things like peak updating. "Live" classes are now atomic and have methods needed for recording allocation/dealocation and updating peaks. "Flat" classes basically just hold data to later be reported, are not atomic, and only have methods for retrieving data. 
> 
> I've also made all counters  in `LiveVirtualMemory` update atomically, when previously only the peaks in `VirtualMemory` were updated atomically.  
> 
> **Testing**
> - tier1
> - jdk/test/hotspot/jtreg/gtest/NMTGtests.java
> - jdk/test/jdk/jdk/jfr/event/runtime/TestNativeMemoryUsageEvents.java

Commenting to prevent this from being closed in 4 weeks.

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

PR Comment: https://git.openjdk.org/jdk/pull/20550#issuecomment-2340929539


More information about the serviceability-dev mailing list