RFR: JDK-8269571: NMT should print total malloc bytes and invocation count

Thomas Stuefe stuefe at openjdk.java.net
Tue Jun 29 07:15:23 UTC 2021


At the moment NMT prints a total of reserved and committed bytes. If one wants to know how much C-Heap the VM uses, one needs to add all numbers from the sub categories.

It would be helpful would NMT print the total number of malloced memory and additionally the malloc invocation count.

----

This patch modifes the printout to print, in addition to totals, the number of malloced bytes, malloc invocation counts, and number of mmap reserved/committed bytes. This mirrors the way we print individual sub categories and allocation sites.

Before:

Native Memory Tracking:

Total: reserved=18489703KB, committed=1183967KB


After:


Native Memory Tracking:

Total: reserved=18491726KB, committed=1183178KB
       malloc: 40590KB #13669
       mmap:   reserved=18451136KB, committed=1142588KB


Tests: Ran hotspot/runtime/NMT jtreg tests.

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

Commit messages:
 - start

Changes: https://git.openjdk.java.net/jdk/pull/4622/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4622&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8269571
  Stats: 25 lines in 3 files changed: 20 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4622.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4622/head:pull/4622

PR: https://git.openjdk.java.net/jdk/pull/4622


More information about the hotspot-runtime-dev mailing list