How to locate Java Process CPU utilization in Linux under the high reason __CPU

Source: Internet
Author: User

First view the CPU-intensive process PID through the top command, and then press 1 after top to see each core occupancy ratio

Top


Here because I am using the virtual machine, even if my Java process occupies a high CPU is only a virtual machine, and the entire machine's CPU is not high. We found pid=7957 here.
And then we're figuring out the CPU-hogging threads based on the PID.

Top-h-P 7957


Then use the Strace-p command to view the invocation based on the thread id=7958

Found the system is constantly printing 1
Then convert the thread decimal thread id=7958 to hexadecimal

Finally grab stack information and see where the code is


I saw the thread 7958, and I got to the fourth line of Test.main, and we opened the code to see

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.