|
top -H
. This will show the threads of the
process broken out individually. Note the process ID (PID) of the
offending thread(s).
Next, convert the thread ID(s) to hexadecimal. This will be needed in
the next step. On Linux, dc
makes quick work of this.
Set it to hexadecimal output (16 o
) then enter the
decimal PID from top
and enter p
. The hex
version of the PID will be displayed.
> dc 16o 1000p 3E8
-H
to find Tomcat's primary PID.
Then, run jstack {PID} > stack.txt
to record the full
stack trace of all threads in Tomcat's JVM. Finally, search through
the stack.txt
file for the lowercase version of
hexadecimal PID you found in the previous step (3e8
in
the example above). It should match one thread's 'NID' (native ID).
This is the offending thread.
"Thread-1" prio=10 tid=0x00007f441435a000 nid=0x3e8 runnable
Copyright © 2024 Andrew Oliver