Linux_ Linux View Memory Usage method Summary __linux

Source: Internet
Author: User

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.

1

$ cat/proc/meminfo

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.

1

$ sudo atop

3. Free

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

1

$ free-h

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.

1

$ gnome-system-monitor

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.

1

$ htop

6. KDE System Monitor

Features the genome version as described in 4.

1

$ ksysguard

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.

1

$ memstat-p <PID>

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.

1

$ nmon

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:

1

$ ps aux--sort-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.

1

$ top

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.

1

$ vmstat-s

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.