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/meminfo
lists 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.
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.
3. Free
The free command is a quick way to view memory usage, which is an overview of the information that/proc/meminfo collects.
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.
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.
6. KDE System Monitor
function with the genome version described in 4.
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.
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.
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:
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.
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