RFR: 8157023: Integrate NMT with JFR

Stefan Johansson sjohanss at openjdk.org
Thu Dec 1 12:22:33 UTC 2022


On Thu, 1 Dec 2022 11:26:03 GMT, Carter Kozak <duke at openjdk.org> wrote:

>> Please review this enhancement to include NMT information in JFR recordings.
>> 
>> **Summary**
>> Native Memory Tracking summary information can be obtained from a running VM using `jcmd` if started with `-XX:NativeMemoryTracking=summary/detail`. Using `jcmd` requires you to run a separate process and to parse the output to get the needed information. This change adds JFR events for NMT information to enable additional ways to consume the NMT data.
>> 
>> There are two new events added:
>> * _NativeMemoryUsage_ - The total native memory usage.
>> * _NativeMemoryUsagePart_ - The native memory usage for each component.
>> 
>> These events are sent periodically and by default the interval is 1s. This can of course be discussed, but that is the staring point. When NMT is not enabled on events will be sent.
>> 
>> **Testing**
>> * Added a simple test to verify that the events are sent as expected depending on if NMT is enabled or not.
>> * Mach5 sanity testing
>
> src/hotspot/share/jfr/metadata/metadata.xml line 709:
> 
>> 707:   </Event>
>> 708: 
>> 709:   <Event name="NativeMemoryUsagePart" category="Java Virtual Machine, Memory" label="Component Native Memory Usage" description="Native memory usage for a component" stackTrace="false" thread="false"
> 
> I found it odd that naming for native memory tracking “parts” aren’t named consistently.  “Category” might be more obvious. I don’t have a strong opinion, just thought I’d mention my observation.

Yes, these names have change a few times during dev and that's why it is out of sync. It should certainly be consistent, but it is really hard to come up with a great name for this. Especially since the different "parts" are so different, compare "GC" and "Object Monitors". Using "Category" has been discussed and I'm not against it, as always naming is very hard.

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

PR: https://git.openjdk.org/jdk/pull/11449


More information about the hotspot-dev mailing list