There is a eclipse plugin "Lockness" for thread dump analysis (http://lockness.plugin.free.fr/setup.php). Using this we can analyze the thread locks to diagonalize the problems. To download (http://lockness.plugin.free.fr/archive/com.cr.lockness.Lockness_3.0.0.jar), put this jar to eclipse3.x/plugins dir and restart eclipse.
How to take a thread dump:
Sending "kill -3 signal to the JBOSS/TOMCAT process" will give you the whole thread dump. Ex: kill -3 #### -> process id.
After executing the above command, you can find thread dump in catalina.out for tomcat or server.log for jboss.
You've to trim the thread dump contents exactly from above log files, such that the dump file starts with "Full thread dump" and end with "VM Thread".
Also, if you have some timestamps added in thread dump, you can trim that using below cut command. For ex: say each line has some time stamps added like "2010-10-25 13:29:23 PDT", then to skip the first 3 columns. Use below command
cat threaddump.txt | cut -d " " -f4- > cut_file_threaddump.txt
The above command will skip first 3 columns and saves rest of the columns what we needed to cut_file_threaddump.txt.
Then from eclipse, create a new java project, create folder pointing to above create dump dir and opening this using "Lockness" thread dump analyser plugin will give you the analysis.
About Me
Showing posts with label threaddump. Show all posts
Showing posts with label threaddump. Show all posts
Tuesday, 26 October 2010
Wednesday, 25 November 2009
How to take a thread dump
Yesterday, I was looking to find whether any daemon thread is running with in jboss server, which does an scheduled job.
Tried ps -efw but it didn't worked, as it's an internal thread, got some suggestions that dumpingthe jboss process will dump the name of daemon threaad and finally it worked great :)
# Find the running boss server process id.
ps -efww | grep 'java' #choose your jboss server pid.
# send thread dump signal.
kill -3 $pid
Tried ps -efw but it didn't worked, as it's an internal thread, got some suggestions that dumpingthe jboss process will dump the name of daemon threaad and finally it worked great :)
# Find the running boss server process id.
ps -efww | grep 'java' #choose your jboss server pid.
# send thread dump signal.
kill -3 $pid
Subscribe to:
Posts (Atom)
