mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 21:44:58 +02:00
Merge pull request #774 from notpeter/java-tools
Java debug tools. Jstack, jmap and jhat.
This commit is contained in:
commit
5cc4eb6415
3 changed files with 45 additions and 0 deletions
11
pages/common/jhat.md
Normal file
11
pages/common/jhat.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# jhat
|
||||||
|
|
||||||
|
> Java Heap Analysis Tool.
|
||||||
|
|
||||||
|
- Analyze a heap dump (from jmap), view via http on port 7000:
|
||||||
|
|
||||||
|
`jhat {{dump_file.bin}}`
|
||||||
|
|
||||||
|
- Analyze a heap dump, specifying an alternate port for the http server:
|
||||||
|
|
||||||
|
`jhat -p {{port}} {{dump_file.bin}}`
|
19
pages/common/jmap.md
Normal file
19
pages/common/jmap.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# jmap
|
||||||
|
|
||||||
|
> Java Memory Map Tool.
|
||||||
|
|
||||||
|
- 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={{filename}} {{java_pid}}`
|
15
pages/common/jstack.md
Normal file
15
pages/common/jstack.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# jstack
|
||||||
|
|
||||||
|
> Java Stack Trace Tool.
|
||||||
|
|
||||||
|
- Print java stack traces for all threads in a java process:
|
||||||
|
|
||||||
|
`jstack {{java_pid}}`
|
||||||
|
|
||||||
|
- Print mixed mode (java/c++) stack traces for all threads in a java process:
|
||||||
|
|
||||||
|
`jstack -m {{java_pid}}`
|
||||||
|
|
||||||
|
- Print stack traces from java core dump:
|
||||||
|
|
||||||
|
`jstack {{/usr/bin/java}} {{file.core}}`
|
Loading…
Add table
Reference in a new issue