How to take thread dump in linux system

-> Get process id by using following command

ps -eaf | grep java

/usr/java/jdk1.5x/bin/jstack -l  1234(process id]) > outputTD1



Or run the following script

rpid= `ps -eaf |grep nextgen| grep jboss-20|awk '{print $2}'`
for i in 1 2 3 4 5 6 7 8 9 10
do
mkdir TD$i
cd TD$i
for j in 1 2 3 4 5 6 7 8 9 10
do
ps -mo pid,lwp,stime,time,pcpu -c java> PSrec$i_$j.out
/usr/java/jdk1.7.x/bin/jstack -l $rpid > outputTD$j
sleep 3
done
sleep 300
cd ../
done



Comments

Popular posts from this blog

Convert Swagger apis into jmeter script

Script for replace the data into the file content using groovy with jsr223

Jmeter Preprocessor to add Dynamic parameters