Check the memory usage of processes in Linux (Linux Performance Tuning)

Source: Internet
Author: User
1. Top


The top command is a common performance analysis tool in Linux. It can display the resource usage of various processes in the system in real time, similar to the Windows Task Manager.

Description:

PID: process ID
User: process owner
PR: process priority. The smaller the value, the higher the execution priority.
Ninice: Value
Virt: Virtual Memory occupied by processes
Res: physical memory occupied by the Process
SHR: shared memory used by the Process
S: the status of the process. S indicates sleep, r indicates running, Z indicates frozen, and N indicates that the priority of the process is negative.
% CPU: CPU usage of processes
% Mem: Percentage of physical memory and total memory used by the Process
Time +: The total CPU time occupied by the process after it is started, that is, the accumulated value of the CPU usage time.
Command: Process startup command name

Common command: P: Ranking by % CPU usage
T: Ranking by mite +
M: ranked by % mem

2./proc/PID

Measure how much memory a process occupies. Linux provides us with a very convenient method. The/proc Directory provides us with all the information: /proc/n process whose PID is n
/Proc/n/cmdline process startup command
/Proc/n/CWD link to the current working directory of the process
/Proc/n/environ process environment variable list
/Proc/n/EXE link to the execution command file of the process
/Proc/n/FD contains all file descriptors RELATED TO THE PROCESS
/Proc/n/maps memory ing information related to processes
/Proc/n/MEM indicates the memory held by the process, which is not readable.
/Proc/n/root link to the root directory of the process
/Proc/n/STAT Process status
/Proc/n/statm process memory usage status
/Proc/n/Status Process status information, more readable than STAT/statm
/Proc/self link to the currently running process

3. The pmappmap command displays the number of memories used by one or more processes. You can use this tool to understand the memory allocated by a process on the server and determine whether this is the cause of memory bottleneck. For more detailed information, use the pmap-D option.

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.