jdk.jcmd/sun.tools.jmap.JMap - "jmap" Command


How to run "jmap" command from JDK lib\modules JImage file?

✍: FYIcenter


"jmap" command allows you to run the JVM heap memory tool.

"jmap" command is supported by the jmods\jdk.jcmd.jmod module file, which is also linked into the lib\modules JImage file in JDK 9, 10, and 11.

You can run the "jmap" command 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.jcmd/sun.tools.jmap.JMap

    jinfo <option> <pid>
       (to connect to a running process)

where <option> is one of:
    -flag <name>         to print the value of the named VM flag
    -flag [+|-]<name>    to enable or disable the named VM flag
    -flag <name>=<value> to set the named VM flag to the given value
    -flags               to print VM flags
    -sysprops            to print Java system properties
    <no option>          to print both VM flags and system properties
    -? | -h | --help | -help to print this help message


⇒ jdk.jcmd/sun.tools.jps.Jps - "jps" Command

⇐ jdk.jcmd/sun.tools.jinfo.JInfo - "jinfo" Command

⇑ Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-09-16, 942👍, 0💬