September 10, 2013
First, capture a threaddump from your process (jvisualvm, kill -3 or jstack should do the trick).
At the same time, get a list of the LWP threads from PS for your process
ps -eLo pid,lwp,nlwp,ruser,pcpu,stime,etime,args -p {PID} >lwpthread.txt Once you have it, sort by CPU utilization and tail the list to get the worst four offenders:
cat lwpthread.txt |sort -n -k 5,5 |tail -n 4 |awk '{print $2}' |xargs Now take the resulting list and throw it in a loop and convert them to hex (note, it must be lowercase!
read more