Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

2020-02-08 16:06:59 Author: Self source: cloud network cattle station

You may have seen many times Linux system consumes too much memory, if this is the case, then the best way is to identify excessive memory consumption of processes on the Linux computer. Use the top command and ps command can easily recognize it, I used to check both commands, and both got the same result.

Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

 

Use the ps command to find the maximum memory consumption process in Linux

ps command is used to report a snapshot of the current process, the ps command process on behalf of the state, which is a standard Linux applications, the process used to find on the Linux operating system running information. It is used to list currently running processes and their process ID (PID), process owner name, process priority (PR) and the absolute path of the running order and so on.

The following ps command format to provide you with more information about the maximum memory consumption process:

# Ps aux --sort -rss | head

Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

Ps using the following command formats may include specific information about the memory consumption in the output process only:

# ps -eo pid,ppid,%mem,%cpu,cmd --sort=-%mem | head

Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

If you want to see the command name, rather than an absolute path command, use the following ps command format:

# ps -eo pid,ppid,%mem,%cpu,comm --sort=-%mem | head

Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

Reference: demonstrate and explain the use of the ps command ps Linux command-case analysis .

 

Use the top command to find the maximum memory consumption process in Linux

Linux top command is everyone used to the best, the most famous command to monitor Linux system performance. It shows real-time view of the system processes running on the interactive interface. However, if you want to find the maximum memory consumption of processes, use the top command in a batch mode, the reference run the top command in batch mode (Batch Mode) .

You should correctly understand the output of the top command to troubleshoot performance problems in the system:

# top -c -b -o +%MEM | head -n 20 | tail -15

Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

If you only want to view the command name, rather than command absolute path, use the following top command format:

# top -b -o +%MEM | head -n 20 | tail -15

Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

 

Use ps_mem order to find the maximum memory consumption process in Linux

ps_mem utility is used to show the core memory used by each program, using this utility, you can check how much memory each program. It calculates the amount of dedicated and shared program memory, and returns the most appropriate manner in total memory used.

It uses the following logic to compute RAM usage (Shared RAM program processes) = sum of the total RAM (RAM dedicated program processes) + the sum of:

# Ps_mem

Use ps, top, ps_mem command to find out the maximum memory consumption process in Linux

 

related topic

Guess you like

Origin www.cnblogs.com/xuanbjut/p/12543636.html