How to take thread dump from JBoss Server

Here are ways to get the thread dump for your JBoss server for performance analysis.

In this article we will see three different ways to take thread dump from JBoss Server.

By using jboss jmx-console

and search "serverInfo" and click on that link 
Click invoke under listThreaddump()
Which will give you current snapshot of threads which are running in JVM.

By using twiddle 

go to <JBOSS-HOME>/bin

In windows -  

twiddle.bat invoke "jboss.system:type=ServerInfo" listThreadDump > dump.html

dump.html will have your thread dump.

In unix-based machines

/jboss/bin/ invoke "jboss.system:type=ServerInfo" listThreadDump > dump.html 2>&1

Using "Interrupt" signal – SIGQUIT

Use kill -3 <process-id> to generate thread dump. You will find the thread dumps in server logs.

Typically to know exact cause you need to take at least 5 to 7 thread dumps with 30 seconds gap, so that you will know what is the common thread which is waiting for long time.

Post a Comment