1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/jmap.md
2023-02-19 21:30:53 +08:00

24 lines
635 B
Markdown

# jmap
> Java memory map tool.
> More information: <https://docs.oracle.com/javase/7/docs/technotes/tools/share/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}}`