How can I quickly locate the most CPU consuming thread in the JVM?

Source: Internet
Author: User

First step, find out the Java process PID

PS grep Process name keyword
This assumes that the PID found is: 12345

Step two, find the most CPU-consuming thread in the process

Top-hp1234517183log4x -   0 4292820 529812  23040R94.7  0.8   1:11.79java-server-xms268435456-xmx26843545617162log4x -   0 4292820 529812  23040R87.1  0.8   1:17.90java-server-xms268435456-xmx26843545617172log4x -   0 4292820 529812  23040R86.1  0.8   1:16.26java-server-xms268435456-xmx26843545617176log4x -   0 4292820 529812  23040R68.0  0.8   1:12.31java-server-xms268435456-xmx26843545617170log4x -   0 4292820 529812  23040S7.3  0.8   0:44.70java-server-xms268435456-xmx268435456

Step three, convert the thread number to hexadecimal

" %x\n " 17183 431f

Fourth step, use Jstack pid to print out all the thread stacks in the process

12345 12345. txt

The fifth step, based on the hexadecimal encoding of the thread, locates the specific thread stack in the stack file.

nid=0x431f

How can I quickly locate the most CPU consuming thread in the JVM?

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.