Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of viewing memory usage by linux

Shulou Source: shulou.com Published: 2022-06-02 00:10:04 09月17日 Update

This article will explain in detail how to check the memory usage of linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Linux's way to view memory usage: you can view it by executing the [cat / proc/meminfo] command. If we want to see the memory usage of the process, we can execute the [/ proc/status] command.

The specific commands are as follows:

1 、 / proc/meminfo

The easiest way to see 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. Memory usage information for processes can also be viewed through / proc//statm and / proc//status.

$cat / proc/meminfo MemTotal: 8010436 kBMemFree: 7514008 kBMemAvailable: 7567204 kBBuffers: 872 kBCached: 282844 kBSwapCached: 0 kBActive: 213156 kBInactive: 111632 kBActive (anon): 41264 kBInactive (anon): 32888 kBActive (file): 171892 kBInactive (file): 78744 kBUnevictable: 0 kBMlocked: 0 kBSwapTotal: 0 kBSwapFree: 0 kBDirty: 32 kBWriteback: 0 kBAnonPages: 41088 kB

2 、 atop

The atop command is a monitoring command for a terminal environment. It shows the synthesis of various system resources (CPU, memory, network, Imax O, kernel) and is marked in color under high load.

$sudo atop

3 、 free

The free command is a quick way to view memory usage, and it is an overview of the information gathered by / proc/meminfo.

$free-h

4 、 GNOME System Monitor

GNOME System Monitor is a view tool that shows the usage of CPU, memory, swap, and network in the most recent period. It also provides a way to view CPU and memory usage.

$gnome-system-monitor

5 、 htop

The htop command shows the real-time memory usage of each process. It provides reports on the resident memory size of all processes, the total program memory size, the shared library size, and so on. The list can scroll horizontally and vertically.

This is the end of $htop's article on "linux's ways to check memory usage". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Memory situation commands methods processes information size articles can be passed tools more good practical usage content dynamic real-time actual in fact color Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL MariaDB Redmi Xiaomi Microsoft