RFR: 8157023: jfr events for nmt

Stefan Johansson sjohanss at openjdk.org
Thu Dec 1 10:58:31 UTC 2022


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

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

Commit messages:
 - Update profile.jfc and explict disable NMT in test
 - Test comments from egahlin
 - Add missing newlines at end of files
 - Basic test for NMT events
 - egahlin comments
 - 8157023: Integrate NMT with JFR

Changes: https://git.openjdk.org/jdk/pull/11449/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11449&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8157023
  Stats: 300 lines in 8 files changed: 293 ins; 5 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/11449.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11449/head:pull/11449

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


More information about the hotspot-dev mailing list