option ] pid
jmap [ option ] executable core
jmap [ option ]
add an example, a script, a trick and tips
jmap -J-d64 -dump:format=b,file=<path to dump
file> <jvm pid>
jhat <path to dump file>
jmap -dump:format=b,file=heapdump 6054
echo >&2 "Usage:
jmapSeries <pid> <run_user> [ <count>
[ <delay> ] ]"
echo >&2 "
Defaults: count = 10, delay = 60 (seconds)"
jmap -J-d64 -heap $pid
echo -n "."
jmap -dump:format=b,file=leak $pid &&\
java -Xmx512m -jar /home/jalp/Java/jhat.jar leak
jmap -heap $PID ============"
jmap -heap $PID
jmap -histo:live $PID ============"
echo "============ jmap
-histo:live $PID ============"
jmap -histo:live $PID
jmap -dump:live,format=b,file=heap-$DATE.bin $PID
prints shared object memory maps or heap memory details of a
given process or core file or a remote debug server. If the
given process is running on a 64-bit VM, you may need
to specify the -J-d64 option, e.g.:
-J-d64 -heap pid
This utility is unsupported and may or may not be available
in future versions of the JDK.
The only forms
of jmap available on the Windows platform are
option> When no option is
used jmap prints shared object mappings. For each shared
object loaded in the target VM, start address, the size of
the mapping, and the full path of the shared object file are
printed. This is similar to the Solaris pmap
Dumps the Java heap in hprof
binary format to filename. The live suboption is
optional. If specified, only the live objects in the heap
are dumped. To browse the heap dump, you can use jhat (Java
Heap Analysis Tool) to read the generated file.
Prints information on objects
Prints a heap summary. GC
algorithm used, heap configuration and generation wise heap
usage are printed.
Prints a histogram of the heap.
For each Java class, number of objects, memory size in
bytes, and fully qualified class names are printed. VM
internal class names are printed with ’*’
prefix. If the live suboption is specified, only live
objects are counted.
Prints class loader wise
statistics of permanent generation of Java heap. For each
class loader, its name, liveness, address, parent class
loader, and the number and size of classes it has loaded are
printed. In addition, the number and size of interned
Strings are printed.
Force. Use with jmap -dump or jmap -histo
option if the pid does not respond. The live
suboption is not supported in this mode.
Prints a help message.
Prints a help message.
Passes <flag> to the Java
virtual machine on which jmap is run.
Options are mutually exclusive. Option, if used, should follow
immediately after the command name.
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, jps may be used.
Java executable from which the core dump was produced.
core file for which the memory map is to be printed.
remote debug server’s (see jsadebugd) hostname or IP
optional unique id, if multiple debug servers are running on the
same remote host.