JDK-8319049 : NMT: report correct memory usage for PrintNMTStatistics
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2023-10-27
  • Updated: 2024-07-25
  • Resolved: 2024-07-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
Description
While working on https://bugs.openjdk.org/browse/JDK-8317453 I noticed that PrintNMTStatistics reports back the "requested" memory size. However, NMT adds additional 20 bytes for the header and footer and OS will next round the size up to fit its memory allocation bucket, so when we report X bytes in reality it's at least X+20, and often way more (especially on macOS) than that.

Any comparison between what VM currently reports and what native tools like pmap report will be way off, making PrintNMTStatistics less useful than expected and confusing.
Comments
NMT Triage: NMT's usage statistics is defined as reporting "what the user allocates", it does not anticipate whatever glibc (for example) allocates as a response to your malloc request.
25-07-2024