From the course: Java Concurrency Troubleshooting: Latency and Throughput

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Collect thread dumps

Collect thread dumps - Java Tutorial

From the course: Java Concurrency Troubleshooting: Latency and Throughput

Start my 1-month free trial

Collect thread dumps

- [Narrator] Let's go over what a thread dump is first. A thread dump is a snapshot of all the threads that the Java process is running. It shows you the status of those threads and a handful of useful tidbits, about the state of things in running Java application. Now that sounds a little more complicated than it is, but I assure you, it's just debug level logging for the JVM. Why would you want a thread dump? Primarily, to see what individual threads inside your JVM are doing at a given moment. You get to see the methods that each running thread is executing and the status of a thread. You also get to see the locks that each thread is holding, very useful for detecting deadlocks between threads. Now, there are a couple of ways to collect thread dumps, so we can have the Java Mission Control or JMC do that for us. I can use the Java Flight Recorder or JFR, I can use the jcmd utility, I can use the jstack utility, I can use…

Contents