Making Sense of Java Thread Dumps

Thread Dump: A dump of

                           threads

  • Only a picture in time
  • Like a video: take multiple pictures to illustrate what is happening
  • Not the full picture: Hard to determine what all was happening without other facts

# of Threads

Thread state

Contending locks
Call stack

Thread States

top

Get a system view of your JVM process

(and other processes)

top

top -b -n3 -H -p <PID>

 

-b: Batch mode

-n3: Take three snapshots

-H: Show threads

-p: Only monitor the specified PID

jcmd

jcmd <PID> Thread.print

 

Capture the thread dump from command line

(like jstack)

Demo Time!

Get on with it!

DevCon 2014:

Diagnose your lethargic JVM

High-level survey of tools to help gauge your JVM's state when it seems unresponsive.

KCDC 2015:

What's in your JVM?

4-hour workshop on a set of free tooling and approaches, which can be applied on profiling your JVM so you have clear visibility of what is occurring during execution.

Learn more!

Made with Slides.com