1. top找到目标进程,记下pid

2. top –p pid, 并用shift+h打开线程模式 
    这样可以看到这个进程中,到底哪个线程占用大量cpu 
    记下threadid,tid

3. jstack查看该线程实时的stack情况 
    jstack [pid]|grep -A 10 [tid(16进制)] , 10表示打印stack的长度,可以选择打印更多的stack信息
    比如,jstack 21125|grep -A 10 52f1

 

http://www.iteye.com/topic/1114219  --参考

Face your past without regret. Handle your present with confidence.Prepare for future without fear. keep the faith and drop the fear. 面对过去无怨无悔,把握现在充满信心,备战未来无所畏惧。保持信念,克服恐惧!一点一滴的积累,一点一滴的沉淀,学技术需要不断的积淀!