Powered By Blogger

Sep 28, 2014

Save the thread dump when server starts as a background service

When you do a normal server start up and if you kill the process using the command 
kill -3 <%PID%> then you can view the thread dump in the console. But if you start the server as a background service then it is impossible to view the thread dump in the console. In order to view it follow the below steps.

1. Start the server as a background process by using the below command 

sh ./wso2server.sh start 

2. Run the below command

jstack %PID% > threaddump.txt

Please note the PID is the process ID and you can get this by running the command ps -ax|grep wso2 )



Also if you start the server with nohup command  (nohup wso2server.sh)  then you can see the thread dump in the nohup.out



No comments:

Post a Comment