jdkjdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper - JVM Heap Dumper

Q

How to run "jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper" tool from JDK lib\modules JImage file?

✍: FYIcenter

A

"jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper" tool allows you to print out heap summary of a given JVM process.

"jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper" tool is supported by the jmods\jdk.hotspot.agent.jmod module file, which is also linked into the lib\modules JImage file in JDK 9, 10, and 11.

You can run the "jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper" tool using the lib\modules JImage file as described below using JDK 11 as an example:

C:\fyicenter>set JDK_HOME=\fyicenter\jdk-11.0.1

C:\fyicenter>%JDK_HOME%\bin\java --module jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper 5136

Attaching to process ID 5136, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 10.0.2+13
Dumping heap to heap.bin ...

 

jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapSummary - JVM Heap Summary

jdk.compiler/sun.tools.serialver.SerialVer - "serialver" Command

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2018-11-18, 212👍, 0💬