- Find JAVA process pid
ps -ef|grep java
or thejps -mlv
- TID time-consuming to find threading under
usetop -Hp pid
can see a process thread information -H display thread information, -p pid specifies the
top -Hp 10906
view that is the most time-consuming thread id TID
printf "%x\n" [tid]
converted to hexadecimal
- thread class in java information
jstack thread ID can view a thread stack situation, especially for the thread hanging dead hung
jstack [pid] | grep [tid]
thread-specific information
jstack -l [pid]
lists all the threads of information.
jstack
jstack is java virtual machine comes with a stack trace tool. Used to generate the java virtual machine snapshot of the current moment thread. A snapshot is a method in the current thread java virtual machine each executing thread stack collection, the main purpose of generating a snapshot of the thread is to locate the thread appears long pause, such as inter-thread deadlocks, infinite loop, long requested external resources caused by time to wait so on.
PS:
In actual operation, often a dump of information, not enough to confirm the problem.Three recommendations emanating from the dump, dump if every point to the same problem, we identify problems of representativeness. That is, multi-threaded snapshots several times to observe the changes, see the problem.