visualvm
visualvm copied to clipboard
Wrong/Inconsistent Max Metaspace value
Visual VM 2.0.7 shows an incorrect Max Metaspace value. If you observe the screenshots below you can see that the application (available at https://github.com/silver-mx/jvm-memory-metrics-demo) was started with -XX:MaxMetaspaceSize=64m
, but Visual VM reports 84MB ( 88 080 384B)
(see screenshot). I double-checked what value is given in JConsole and that it is 65 536 kbytes
which is accurate (see screenshot).
To Reproduce Steps to reproduce the behavior:
- Clone the repository available at https://github.com/silver-mx/jvm-memory-metrics-demo.
- Run
mvnw spring-boot:run
- Open VisualVM 2.0.7 and click on the application com.dns.metrics.JvmMemoryMetricsApplicationDemo
- Observe the Metaspace Max value.
Expected behavior
I expect the Metaspace max value to reflect the 64MB assigned via XX:MaxMetaspaceSize=64m
.
Screenshots
Desktop (please complete the following information):
- OS: [Windows 10 and Linux Manjaro]
- JDK version [jdk-16.0.1.9-hotspot]
- Version [16]
This bug can be reproduce only if the memory is monitored via jvmstat (typically for local process). Monitoring via JMX (typically remote process) works fine.