Overview of how to view memory usage under Linux

Source: Internet
Author: User

Linux view CPU and memory usage: http://www.cnblogs.com/xd502djj/archive/2011/03/01/1968041.html

Physical memory is one of the most important aspects of optimizing Linux systems. Naturally, Linux also provides a number of ways to monitor the use of valuable memory resources. The following checklist provides a detailed list of various ways to view memory usage by using the View tool or the command line under Linux systems.

1./proc/meminfo

The simplest 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/meminfolists all the memory usage you want to know. Memory usage information for processes 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 the synthesis of various system resources (CPU, memory, network, I/O, kernel), and is color-coded in the case of high loads.

1

$ sudo atop

3. Free

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

1

$ free-h

4. GNOME System Monitor

GNOME System Monitor is a view tool that displays the CPU, memory, swap, and network usage in the most recent 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 utilization of memory 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 be scrolled horizontally and vertically.

1

$ htop

6. KDE System Monitor

function with the genome version described in 4.

1

$ ksysguard

7. MemStat

MemStat is a command that effectively identifies executable (s), process (es) and shared libraries using virtual memory conditions. 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 interaction patterns of CPUs, memory, I/O, file systems, and network resources. For the use of memory, it can display the total/remaining memory, swap space and other information in real time.

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 the virtual memory use d), and RSS (total amount of physical memory used). You can use the "–sort" option to sort processes, such as by RSS:

1

$ ps aux--sort-rss

Ten. Smem

The Smem command allows you to count the memory usage of different processes and users based on/proc information. Memory usage analysis allows you to export charts (such as bar charts and pie charts).

1

$ sudo smem--pie name-c" PSS "

Top

The top command provides real-time resource usage statistics for running programs. You can sort by the use and size of the memory.

1

$ top

Vmstat.

The Vmstat command shows real-time, peaceful statistics, covering CPU, memory, I/O, and so on. For example, the memory situation shows not only physical memory, but also virtual memory.

Overview of how to view memory usage under Linux

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.