How to view the memory occupied by a process under Linux

Source: Internet
Author: User

Linux to see the memory occupied by a process, the first can be found through the PS command process ID, such as PS -ef | grep Kafka can see the process ID of this program Kafka

  

As you can see is 2913, you can now view the memory using the following command:

2913

  

This allows you to see CPU and memory occupancy in real time, and then press Q to return to the command line

You can also use the PS command directly to view: PS -aux | grep Kafka

  

The first dimension is CPU and memory occupancy, and the next 943100 is the amount of physical memory used, in K, at which time the Kafka consumes about 943M of memory

You can also view the status file for a process: cat /proc/2913/status

  

The vmrss corresponds to the physical memory footprint, about 943M and just the same

You can also view memory consumption dynamically with the top command

By: ps aux | Sort -k4,4nr | Head - n -View the top 10 memory-consuming programs

How to view the memory occupied by a process under Linux

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.