To see if a thread is high on the CPU

Source: Internet
Author: User

JPS get PID

pidstat-p [PID]-T-T represents the information that displays all the threads in the process

06:20:32 PM tgid TID%usr%system%guest%cpu CPU Command
06:20:32 PM 2996-6.16 0.22 0.00 6.38 Java
06:20:32 PM-2996 0.00 0.00 0.00 0.00
06:20:32 PM-3068 0.00 0.00 0.00 0.00 1 |__java
06:20:32 PM-3069 0.12 0.00 0.00 0.12
06:20:32 PM-3070 0.12 0.00 0.00 0.12
06:20:32 PM-3071 0.12 0.00 0.00 0.12
06:20:32 PM-3072 0.12 0.00 0.00 0.12 8 |__java

For example, using thread Id:tid 2996,

Convert to 16 binary: Echo ' 3068 ' |      awk ' {printf ("\\x%02x\\x%02x\n", $1/256, $1%256);} ' Get \x0c\x1a

jstack-l [PID] >> textfile

Go to jstack output file Textfile to find the one that Nid is C1A, the thread that generally accounts for the higher CPU is the GC thread of the JVM.

To see if a thread is high on the CPU

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.