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

Q

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

✍: FYIcenter

A

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

"jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapSummary" 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.HeapSummary" 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.HeapSummary 5136

Summary 5136
Attaching to process ID 5136, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 11.0.1

using thread-local object allocation.
Garbage-First (G1) GC with 2 thread(s)

Heap Configuration:
   MinHeapFreeRatio         = 40
   MaxHeapFreeRatio         = 70
   MaxHeapSize              = 1073741824 (1024.0MB)
   NewSize                  = 1363144 (1.2999954223632812MB)
   MaxNewSize               = 643825664 (614.0MB)
   OldSize                  = 5452592 (5.1999969482421875MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 260046848 (248.0MB)
   MaxMetaspaceSize         = 268435456 (256.0MB)
   G1HeapRegionSize         = 1048576 (1.0MB)

Heap Usage:
G1 Heap:
   regions  = 1024
   capacity = 1073741824 (1024.0MB)
   used     = 60424704 (57.62548828125MB)
   free     = 1013317120 (966.37451171875MB)
   5.62748908996582% used
G1 Young Generation:
Eden Space:
   regions  = 33
   capacity = 49283072 (47.0MB)
   used     = 34603008 (33.0MB)
   free     = 14680064 (14.0MB)
   70.2127659574468% used
Survivor Space:
   regions  = 7
   capacity = 7340032 (7.0MB)
   used     = 7340032 (7.0MB)
   free     = 0 (0.0MB)
   100.0% used
G1 Old Generation:
   regions  = 18
   capacity = 1017118720 (970.0MB)
   used     = 17433088 (16.62548828125MB)
   free     = 999685632 (953.37451171875MB)
   1.7139678640463918% used

23990 interned Strings occupying 1712584 bytes.

 

jdk.hotspot.agent/sun.jvm.hotspot.tools.jcore.ClassDump - JVM Class Dumper

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

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-09-27, 267👍, 0💬