Linux Jstack Analysis CPU consumption 100%

Source: Internet
Author: User
Background:

After running the test program, the top command discovers that a process (PID) consumes 100% CPU.

See which thread is consuming the most resources:

PS MP Pid-o Thread,tid, command to see all the thread usage under this process.

found that thread 324 occupies the most.

Use JSTACK for tracking:

Jstack pid for viewing output to temp file

Jstack 324> Test

Convert the most CPU-intensive thread ID (324) to 16 binary, 324== "144

To view Jstack generated files:

Below you can see which line of code is causing the line of code to see the dead loop. The trace is resolved.

The above is a look at CPU usage, extrapolate, other related resource analysis methods should be similar.

This kind of check up the problem to have a sense of accomplishment, with our cattle and cattle development of a trick after everyone can also use up ~ ~ ~

Postscript:
Test attention to a lot of things, point to face, and then surface to the points, and developers in the technical understanding will be a lot of analysis methods, we found that the bug is not directly lost to development, fix after the peripheral regression, but to develop consulting analysis method, get "fishing", development is also very happy to teach us, In this way we will have a similar problem in the future can be directly analyzed, so as to constantly improve themselves, improve efficiency, and will have a sense of accomplishment, this is a very happy thing.

from:http://testing.etao.com/node/615

Linux Jstack Analysis CPU consumption 100%

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.