Q: I want to monitor the memory usage of the Linux system and what views or command-line tools are available under Linux.
Physical memory is one of the most important aspects of Linux system optimization. Naturally, Linux also provides a number of ways to monitor the use of valuable memory resources. The following list details the various ways to view memory usage under a Linux system, either through the View tool or the command line. 1./proc/meminfo
The easiest way to view 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. The memory usage information for the process can also be viewed through/PROC/<PID>/STATM and/proc/<pid>/status.
2. Atop
The atop command is a monitoring command for a terminal environment. It shows a combination of various system resources (CPU, memory, network, I/O, kernel) and is color-coded in high load situations.
3. Free
The free command is a quick way to view memory usage, which is an overview of the information gathered by/proc/meminfo.
4. GNOME System Monitor
GNOME System Monitor is a view tool that displays the CPU, memory, swap area, and network usage over the last period of time. It also provides a way to view CPU and memory usage.
5. Htop
The Htop command shows the real-time memory usage for each process. It provides reports on the resident memory size, total program memory size, shared library size, and so on for all processes. The list can scroll horizontally and vertically.
6. KDE System Monitor
Features the genome version as described in 4.
7. MemStat
MemStat is a command that effectively identifies executable (s), process (es), and shared libraries using virtual memory. Given a process Id,memstat can list the executable files, data, and shared libraries associated with this process.
8. Nmon
Nmon is a ncurses based system benchmarking tool that monitors the interactive patterns of CPU, memory, I/O, file systems, and network resources. For the use of memory, it can display real-time total/surplus memory, swap space and other information.
9. PS
The PS command can display the memory usage of each process in real time. Reported memory usage information includes%MEM (percent of physical memory used), VSZ (total amount of virtual memory use d), and RSS (total amount of physical memory used). You can sort processes by using the "–sort" option, such as by RSS:
Smem
The Smem command allows you to count the different processes and user memory usage based on/proc information. Analysis of memory usage can export charts, such as bars and pie charts.
1 |
$ sudo smem--pie name-c "PSS" |
One . Top
The top command provides resource usage statistics for real-time running programs. You can sort by the use and size of memory.
Vmstat
The Vmstat command shows real-time statistics of peace, covering CPU, memory, I/O, and so on. For example, memory condition, not only shows physical memory, but also counts virtual memory.