JDK-8198553 : jcmd: separate Metaspace statistics from NMT
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-02-22
  • Updated: 2018-06-06
  • Resolved: 2018-02-22
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.
JDK 11
11 b03Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
JDK-8189688 introduced metadata printing into NMT. This is a very useful feature. However, it is tied to NMT, which is unnecessary. 

Currently, we have to trigger metadata statistics with jcmd with the NMT-printing command "VM.native_memory metadata". In order for that to work, NMT must have been enabled first in the monitored VM - so, the VM must have been started with -XX:NativeMemoryTracking=... . If not, "jcmd VM.native_memory" will give us an error. This diminishes its usefulness. We have many customer scenarios where we cannot restart the VM to enable NMT but still would like to see metadata statistics.

The metadata statistics do not need the NMT infrastructure, they work perfectly fine without it. We should remove metadata statistics from "VM.native_memory" and make it an own first-class diagnostic command.

(Prior discussion on hotspot-runtime: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2018-February/026354.html)

----------

Update: The final form of this patch adds the new diagnostic command "VM.metaspace".


Comments
Ah, thanks! Then my fix should be fine.
22-02-2018

My mistake; I was talking about this snippet from this discussion: On Wed, Feb 14, 2018 at 3:19 PM, Thomas St��fe <thomas.stuefe at gmail.com> wrote: > On Wed, Feb 14, 2018 at 3:11 PM, <coleen.phillimore at oracle.com> wrote: > >> This sounds good to me. Will NMT still print the metadata statistics >> when you use -XX:+PrintNMTStatistics? >> Coleen >> >> > Yes, you are right, that should be preserved. > > ..Thomas And I confused -XX:+PrintNMTStatistics with a diagnostic command.
22-02-2018

>> We should remove metadata statistics from "VM.native_memory" and >> make it an own first-class diagnostic command. > >I believe the decision was to report metadata statistics via both >diagnostic commands. Which both commands? I only see one (VM.native_memory, sub command "metadata").
22-02-2018

> We should remove metadata statistics from "VM.native_memory" and > make it an own first-class diagnostic command. I believe the decision was to report metadata statistics via both diagnostic commands.
22-02-2018