sun.tools.jmap.JMap - "jmap" Command

Q

How to run "jmap" command from JDK tools.jar file?

✍: FYIcenter

A

"jmap" command allows you to dump heap memory area of a given JVM process on your computer system.

"jmap" command is supported by the lib\tools.jar JAR file JDK 1, 2, 3, 4, 5, 6, 7, and 8.

You can run the "jmap" command using the JDK tools.jar file as described below using JDK 8 as an example:

C:\fyicenter>set JDK_HOME=\fyicenter\jdk-1.8.0_191

C:\fyicenter>%JDK_HOME%\bin\java -cp %JDK_HOME%\lib\tools.jar sun.tools.jmap.JMap

Usage:
    jmap -histo <pid>
      (to connect to running process and print histogram of java object heap
    jmap -dump:<dump-options> <pid>
      (to connect to running process and dump java heap)

    dump-options:
      format=b     binary default
      file=<file>  dump heap to <file>

    Example:       jmap -dump:format=b,file=heap.bin <pid>

 

sun.tools.jstack.JStack - "jstack" Command

sun.tools.jps.Jps - "jps" Command

Tools Supported from JDK 8- JAR Files

⇑⇑ FAQ for JDK (Java Development Kit)

2018-11-09, 241👍, 0💬