Home  >  Article  >  Operation and Maintenance  >  How to check memory in linux?

How to check memory in linux?

藏色散人
藏色散人Original
2020-10-13 17:35:3560893browse

How to check the memory in Linux: 1. Check the memory through the "/proc/meminfo" method; 2. Use the free command to check the memory; 3. Use the ps command to display the memory usage of each process; 4. Use top The command displays the real-time memory usage of each process.

How to check memory in linux?

Recommendation: "linux course"

1) The easiest way to check RAM usage is through /proc /meminfo. This dynamically updated virtual file is actually a combination of many other memory-related tools (such as free/ps/top). /proc/meminfo lists all the memory usage you want to know about.

$ cat /proc/meminfo

How to check memory in linux?

2) The free command is a quick way to view memory usage. It is an overview of the information collected by /proc/meminfo.

How to check memory in linux?

#3) The ps command can display the memory usage of each process, as well as more detailed physical memory usage and virtual memory usage. You can use the "-sort" option to sort processes, such as sorting by RSS:

$ ps aux --sort -rss

How to check memory in linux?

4) The top command displays the real-time memory usage of each process. It provides reports on the resident memory size of all processes, total program memory size, shared library size, etc.

How to check memory in linux?

The above is the detailed content of How to check memory in linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn