2016-02-16 11:27:52 -08:00
|
|
|
# jmap
|
|
|
|
|
2022-10-11 04:59:50 +02:00
|
|
|
> Java memory map tool.
|
2023-06-04 07:18:54 +05:30
|
|
|
> More information: <https://docs.oracle.com/en/java/javase/20/docs/specs/man/jmap.html>.
|
2016-02-16 11:27:52 -08:00
|
|
|
|
2021-07-13 10:59:48 +02:00
|
|
|
- Print shared object mappings for a Java process (output like pmap):
|
2016-02-16 11:27:52 -08:00
|
|
|
|
|
|
|
`jmap {{java_pid}}`
|
|
|
|
|
|
|
|
- Print heap summary information:
|
|
|
|
|
2016-02-16 12:36:36 -08:00
|
|
|
`jmap -heap {{filename.jar}} {{java_pid}}`
|
2016-02-16 11:27:52 -08:00
|
|
|
|
|
|
|
- Print histogram of heap usage by type:
|
|
|
|
|
|
|
|
`jmap -histo {{java_pid}}`
|
|
|
|
|
|
|
|
- Dump contents of the heap into a binary file for analysis with jhat:
|
|
|
|
|
2022-12-06 07:47:56 +01:00
|
|
|
`jmap -dump:format=b,file={{path/to/file}} {{java_pid}}`
|
2023-02-19 21:30:53 +08:00
|
|
|
|
|
|
|
- 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}}`
|