Taking thread dumps of Java cartridges
In this recipe, you will learn how to take thread dumps of your Java cartridge applications. A thread dump lists all the Java threads that are currently active in a Java Virtual Machine (JVM). It can help you understand the state of every thread in the JVM at a particular point in time. It gives you a snapshot of exactly what's executing at a moment in time. Thread dumps are very useful to debug a deadlock condition or to understand resource usage.
Note
This command will work with all the four supported Java cartridges (Apache Tomcat 6, Apache Tomcat 7, JBoss AS7, and JBoss EAP).
Getting ready
This recipe will request for a thread dump of the application created in the Creating and deploying Java EE 6 applications using the JBoss EAP and PostgreSQL 9.2 cartridges recipe. So, please refer to the aforementioned recipe before continuing with this recipe.
How to do it…
Perform the following steps to take a thread dump of your Java application:
Open a new command...