Linu the Java program consumes high CPU and memory error handling scheme

Source: Internet
Author: User

1: View all process pid through the JPS command.

2: Use top-p PID to view the CPU and memory and load of the process for the PID you are looking for


Use top-p pid-h to view CPU-intensive queries for each thread


If you find that a certain PID CPU is too high, you can get this PID into 16 binary

For example, PID 12760 is converted to 16 binary 31d8, uppercase to lowercase

Jstack 22821|grep-a 0x31d8
For each of your threads to take out CPU-intensive stack information, you can use this to find the CPU
If you have a high memory footprint, I prefer to use the Jmap command  jmap -histo:live 9652 | head -n 100

Jmap-heap 12733


Linu the Java program consumes high CPU and memory error handling scheme

Related Article

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.