Collecting JVM thread dumps
This guide describes how to generate JVM thread dumps.
Step 1: Getting PID
Find out the PID of the Java process.
macOS/Linux
ps -el | grep java
Windows
Press Ctrl+Shift+Esc
to open Task Manager and find the PID of the Java process.
Step 2: Generating thread dump
Use jstack to print the thread dump to the command line:
jstack -l <pid>
You can save thread dumps for multiple processes into a single file. Redirect the jstack
output using the output
redirection:
jstack -l <pid> >> threaddumps.log