打开top,按shift+H。帮助文档说明:
-H : Threads toggle
Starts top with the last remembered 'H' state reversed. When
this toggle is On, all individual threads will be displayed.
Otherwise, top displays a summation of all threads in a
process.
就可以找出最耗cpu的线程pid,例如1688,对应十六进制是698。
再用jstack dump一下。找出nid是698的线程,这条线程就是你要找的线程了。
[color=white]作者:翁志艺[/color]
-H : Threads toggle
Starts top with the last remembered 'H' state reversed. When
this toggle is On, all individual threads will be displayed.
Otherwise, top displays a summation of all threads in a
process.
就可以找出最耗cpu的线程pid,例如1688,对应十六进制是698。
再用jstack dump一下。找出nid是698的线程,这条线程就是你要找的线程了。
[color=white]作者:翁志艺[/color]
本文介绍了一种通过top命令和jstack工具定位高CPU占用线程的方法。具体步骤为:使用top命令按shift+H显示线程详情,找到消耗CPU最高的线程PID,如1688(十六进制698),然后使用jstack工具dump线程堆栈,进一步定位问题线程。
1369

被折叠的 条评论
为什么被折叠?



