Linux memory viewing tool --- Smem, linux view --- smem
Insufficient physical memory has a great impact on the performance of Linux desktop and server systems. When your computer slows down, the first thing to do is to release the memory. Especially in a multi-user environment and a server environment that executes key tasks, memory consumption becomes more critical because multiple users and application threads will compete for more memory space at the same time.
To monitor the usage of various resources in the system (such as CPU or memory), graphical display is an efficient method. You can quickly analyze the resource consumption of each user and process through the graphical interface. In linux, the memory usage is analyzed using the command line tool smem.
Physical memory usage: RSS, PSS, and USS
Since Linux uses virtual memory, it is not that easy to accurately calculate the physical memory actually used by a process. Only knowing the virtual memory size of the process is not very useful, because the actual physical memory size still cannot be obtained.
· RSS (Residentset size), which can be queried using the top Command, is the most common memory indicator, indicating the physical memory size occupied by processes. However, adding the RSS values of each process usually exceeds the memory consumption of the entire system, because RSS contains the memory shared by each process.
· PSS (Proportionalset size) will be more accurate. It average the size of the shared memory and then shares it with various processes.
· USS (Unique set size) is a part of PSS. It only calculates the memory size occupied by the process independently and does not contain any shared part.
Common Parameters
$ Smem
By default, if no parameter is specified, the memory usage of all processes is displayed at a time rather than dynamically.
$ Smem-m
Display memory usage of each database
$ Smem-p | grepfirefox
Display usage by percentage
$ Smem-u-p
Usage Statistics by users
Graphic results
If you use a graphical interface, you can also generate graphical results.
Pie Chart
Smem -- pie name-s uss
Bar Chart
Smem -- bar pid-c "pss uss rss"