HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

jmap — Java memory map tool. More information: <https://docs.oracle.com/en/java/javase/25/docs/specs/man/jm

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandmemoryclitoolmapjavajmapmore

Problem

How to use the jmap command: Java memory map tool. More information: <https://docs.oracle.com/en/java/javase/25/docs/specs/man/jmap.html>.

Solution

jmap — Java memory map tool. More information: <https://docs.oracle.com/en/java/javase/25/docs/specs/man/jmap.html>.

Print shared object mappings for a Java process (output like pmap):
jmap {{java_pid}}


Print heap summary information:
jmap -heap {{filename.jar}} {{java_pid}}


Print histogram of heap usage by type:
jmap -histo {{java_pid}}


Dump contents of the heap into a binary file for analysis with jhat:
jmap -dump:format=b,file={{path/to/file}} {{java_pid}}


Dump live objects of the heap into a binary file for analysis with jhat:
jmap -dump:live,format=b,file={{path/to/file}} {{java_pid}}

Code Snippets

Print shared object mappings for a Java process (output like pmap)

jmap {{java_pid}}

Print heap summary information

jmap -heap {{filename.jar}} {{java_pid}}

Print histogram of heap usage by type

jmap -histo {{java_pid}}

Dump contents of the heap into a binary file for analysis with jhat

jmap -dump:format=b,file={{path/to/file}} {{java_pid}}

Dump live objects of the heap into a binary file for analysis with jhat

jmap -dump:live,format=b,file={{path/to/file}} {{java_pid}}

Context

tldr-pages: common/jmap

Revisions (0)

No revisions yet.