Use jstack to output the stack information in Java process to the specified file and analyze it

1. Printing stack information using jstack command

jstack -l pid >> thread.txt

Parameter: – l long lists to print out additional lock information. Jstack – L PID can be used to observe the lock holding status when a deadlock occurs


jstack -l 7052 >> thread.txt

2. Analyze stack information

take thread.txt Download it locally and use IBM thread and monitor dump analyzer for Java to open the analysis

Read More: