View thread information on the most time-consuming java linux

  1. Find JAVA process pid
    ps -ef|grep javaor thejps -mlv
    Here Insert Picture Description
  2. TID time-consuming to find threading under
    use top -Hp pidcan see a process thread information -H display thread information, -p pid specifies the
    top -Hp 10906view that is the most time-consuming thread id TID
    Here Insert Picture Description
    printf "%x\n" [tid]converted to hexadecimal
    Here Insert Picture Description
  3. 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.
    Here Insert Picture Description

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.

Published 418 original articles · won praise 745 · Views 1.26 million +

Guess you like

Origin blog.csdn.net/u013467442/article/details/89511656