Friday, September 26, 2008

How to get a thread dump of WSO2 Servers

I will explain in terms of the product WSO2 ESB.
When WSO2 ESB server is running, find the process ID by using the following command

 ps -ef | grep wso2esb

Once you find the process ID, use the following command and then you will get a thread dump on the WSO2 ESB console

kill -3 [ProcessID_of_WSO2ESB]

Also, you can get the thread dump to a text file by giving a command as follows

jstack $PID > thread_dump.txt

2 comments:

Asanka Abeysinghe said...

You can do the above task using one command
Option 1 : kill `ps -ef | grep wso2esb | grep -v grep | awk '{print $2}'`
Option 2 : kill $(pgrep wso2esb)

Evanthika said...

Thanks for the info asanka