How to Generate a Thread Dump of your JAVA process. Print

  • 9

A thread dump reveals information about an application's thread activity that can help you diagnose problems and better optimize application and JVM performance when using our Java hosting packages.

Step 1) Note the process ID number of the Java process using below command.

"ps -u USER" where USER is your username and then you look for the 'java' process

Example:

[bktsttom@jpcloudusa004 ~]$ ps -u bktsttom
PID TTY          TIME CMD
57833 ?        23:44:31 java
17729 pts/2    00:00:00 bash
17781 pts/2    00:00:00 ps

Notice the PID column? You want the PID number corrisponding to the java row.

Step 2) send a QUIT signal to the process with the kill -QUIT

Example:

kill -QUIT 57833

Step 3) Read logs in tomcat/logs/catalina.out.

Example:

[bktsttom@jpcloudusa004 ~]$ tail -200 tomcat/logs/catalina.out
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.45-b01 mixed mode):
"TP-Monitor" daemon prio=10 tid=0x00007f2334326800 nid=0xe202 in Object.wait() [0x00007f22f98d3000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)

Was this answer helpful?

« Back