Java Process Analysis

Source: Internet
Author: User

1. Find out the Java process PID, such as 11327

2. Using Jstack to see the lock holding situation

/usr/java/latest/bin/jstack-l 11327

3. Output Java stack information, and C + + stack information

/usr/java/latest/bin/jstack-m 11327

4. Find the most CPU-consuming thread

TOP-HP 11327

Find out 11341 time consuming the longest

5. Convert the thread ID to hexadecimal

printf "%x\n" 11341

The result is: 2c4d

6. Filter the stack information corresponding to the thread

/usr/java/latest/bin/jstack 11327 |grep 2c4d

7. Use Jmap to view process heap memory usage, including GC algorithms, heap configuration parameters, and heap memory usage in each generation

/usr/java/latest/bin/jmap-heap 11327

8. Use Jmap to view the number of objects in the heap memory, the size statistics histogram, and if you bring live, only live objects are counted, as follows:

/usr/java/latest/bin/jmap-histo:live 11327 | More

These are the commands and parameters used in the analysis process,

Java Process Analysis

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.