Windows pull out Java programs that consume high CPU threads

Source: Internet
Author: User

1. Locate the PID corresponding to the Java process. Through Task Manager. Linux---Top

2. Then export the Java process snapshot. Run the command directly. Stack-l 31372 > c:/31372.stack

3. Under Windows, you can only view the CPU utilization of the process, to see the CPU utilization of the thread with other tools, I use the Microsoft-provided process Explorer v15.3

Right-click the process you want to see---properties

Linux first enter top, and then press shift+h or "H", at this time the thread view is open, PID is the thread number

4. Then select the Threads tab to find the TID for the CPU-consuming thread, for example, I'm a 31876 thread here.

5. Convert the PID into 16, I am here directly with the system of the calculator conversion, placed on why to convert, because the previous information exported with Jstack in the thread corresponding to the TID is 16 binary.

CMD---calc---the upper left corner of the calculator select programmer, which can be converted into binary. Finally get the 16 binary value of the thread PID is 7c84

6. Find 7c84 in the 31372.stack file in C drive

Thread-23 "prio=6 tid=0x03072400 nid= 0x1b68runnable [0x0372f000]

Java.lang.Thread.State:RUNNABLE

At Com.horn.util.MyEncrypt.encode (Myencrypt.java:)

At Com.horn.common.OrderUtil.hisExp (Orderutil.java:228)

At COM.HORN.UTIL.MSGMANAGE.RECEIVEMSG (Msgmanage.java:961)

At Com.horn.util.PollMessageThread.run (Pollmessagethread.java:)

Locked ownable synchronizers:-None

Windows pull out Java programs that consume high CPU threads

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.