Pre-General Availability: 2017-05-24

jmap

You use the jmap command to print shared object memory maps or heap memory details of a specified process or a remote debug server. This command is experimental and unsupported.

Synopsis

jmap [options] pid
options

The command-line options. See Options for the jmap Command.

pid

The process ID for which the memory map is to be printed. The process must be a Java process. To get a list of Java processes running on a machine, use the jps command.

Description

The jmap command prints shared object memory maps or heap memory details of a specified process or remote debug server.

Note:

This command is unsupported and might not be available in future releases of the JDK. On Windows Systems where the dbgeng.dll file isn’t present, Debugging Tools for Windows must be installed to make these tools work. The PATH environment variable should contain the location of the jvm.dll file that’s used by the target process or the location from which the coredump file was produced.

Options for the jmap Command

-clstats pid

Connects to a running process and prints class loader statistics of Java heap.

-finalizerinfo pid

Connects to a running process and prints information on objects awaiting finalization.

-histo[:live] pid

Connects to a running process and prints a histogram of the Java object heap. If the live suboption is specified, it then counts only live objects.

-dump:dump options pid

Connects to a running process and dumps Java heap. The dump options include:

  • live — When specified, dump only the live objects; if not specified, then dump all objects in the heap.

    format=b — Dumps the Java heap,. in hprof binary format

  • file=filename — Dumps the heap to filename

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