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
The previous screenshot shows the output of the thread dump command in catalina.out
logs. We can see that the highlighted section shows the http-bio-8080- Acceptor
thread status, which is currently in a runnable state, which means that the thread is alive and performing its functionality for the application.
Once the thread generation is complete, it then collects the memory dump for the Java processes. The previous screenshot shows the memory status...