使用top检查Linux中的Java线程 [英] Inspecting Java threads in Linux using top
问题描述
我正在使用来检查Linux中的Java进程
I am inspecting a Java process in Linux using
top -H
但是,我无法在"COMMAND"列中读取线程的名称(因为它太长了).如果我使用'c'扩展进程的全名,那么它仍然很长.
However, I cannot read the name of the thread in the "COMMAND" column (because it is too long). If I use 'c' to expand the full name of the process, then it is still to long to fit.
如何获取命令的全名?
推荐答案
您可以使用工具jstack
检查Java线程.它将列出属于指定进程pid的所有线程的名称,堆栈跟踪和其他有用的信息.
You can inspect java threads with the tool jstack
. It will list the names, stacktraces and other useful information of all threads belonging to the specified process pid.
编辑:jstack的线程转储中的参数nid是LWP的十六进制版本,在线程的pid列中顶部显示.
Edit: The parameter nid in the thread dump of jstack is the hex version of the LWP that is displayed by top in the pid column for threads.
这篇关于使用top检查Linux中的Java线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!