How to obtain a thread dump in Tomcat 7

The thread dump is a way through which we can determine the application-level thread status for any Java process. There are many ways to obtain a thread dump in Tomcat; here we will discuss two different ways which are widely used in the IT environment.

Thread dump using Kill command

This command generates and redirects the thread dump in catalina.out log. But, the limitation to this command is it works in a non-DOS environment such as Linux, Unix, and so on.

Kill -3 java process id

For example:

Kill -3 10638
Thread dump using Kill command

The previous screenshot shows the output of the thread dump command in catalina.out logs. We can see ...

Get Apache Tomcat 7 Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.