Linux check memory-free, top

Source: Internet
Author: User
Tags memory usage

One, free

Displays the unused and used memory states of the current system, including physical memory, virtual swap file memory, shared memory segments, and buffers used by the system core, etc.
1. Parameter description
-B: Displays memory usage in bytes;-K: Displays memory usage in kilobytes;-M: Displays memory usage in megabytes;
-G displays memory usage in gigabytes;-O: does not display buffer throttling column;-s< interval seconds;: Continuous observation of memory usage;-T: Displays the memory sum column;-V: Displays the version information.
2. Example

Total: Number of memory, used: Number of memory used, free: idle memory, shared: Currently obsolete, buffers: Cache memory, Cached: Cache memory.
-/+ buffer: For storing data to be output to disk (block device), the cache is the data read from disk. Both are designed to improve IO performance and are managed by the OS
-buffers/cache Memory: 1397032 (equals 1th row of used-buffers-cached)
+buffers/cache Memory: 2752124 (equals 1th line of Free + buffers + cached)
Swap: Swap partition

Second, top

Displays information about the processes currently being executed by the system, including process IDs, memory usage, CPU utilization, etc.
1. Parameter description
-B: Operation in batch mode;-C: Display full command;-d: Screen refresh interval,-I: Ignore failure process;-S: secrecy mode;-S:;-i< time for Cumulative mode: Set interval;-u< username;: Specify user name;-p< Process Number: Specifies the number of process;-n<;: The number of times the loop is displayed.
2. Example

The first line, the task queue information, the specific parameters described as follows:

14:18:28-Current system time

Up 2 day, 5:44-system has been running for 2 days, 56 hours, 44 minutes

2 users-currently has 2 users logged into the system

The three numbers behind the load average:1.08, 1.08, 0.98-load average are 1-minute, 5-minute, 15-minute loads respectively.

The load average data is the number of active processes that are checked every 5 seconds and then calculated by a particular algorithm. If this number is divided by the number of logical CPUs, the result above 5 indicates that the system is overloaded.

The second line, tasks-task (process), specific information is as follows:

The system now has 377 processes, of which there are 2 running, 375 in hibernation (sleep), 0 in the stoped state, and 0 in the zombie State (zombie).

The third line, CPU status information, the specific properties are described as follows:

11.3%us-the percentage of CPU occupied by the user space.

2.0% sy-The percentage of CPU consumed by the kernel space.

0.0% ni-The percentage of CPU that has changed the priority of the process

86.6% id-Idle CPU percentage

0.1% Wa-io waiting for CPU percentage

0.0% hi-Hard Interrupt (Hardware IRQ)% of CPU occupied

0.0% si-Soft Interrupt (software interrupts)% of CPU occupied

the fourth line, the memory state, the specific information is as follows :

20472700k total-Total Physical memory

20288656k used-Total Memory in use

180444k free-Total Free memory

The amount of memory in 253828k buffers-cache

line fifth, swap swap partition information, specific information is described as follows :

Total 4194296k total-Swap Area

Total swap area used by 43340k used-

4150956k free-free Swap area total

18809728k cached-buffered swap area total)

Line seventh below: status monitoring of each process (task), the project column information is described as follows:

pid-Process ID

user-Process Owner

pr-Process Priority

The Ni-nice value. Negative values indicate high priority, positive values indicate low priority

The total amount of virtual memory used by the virt-process, in kilobytes. Virt=swap+res

The size, in kilobytes, of the physical memory used by the res-process and not swapped out. Res=code+data

shr-shared memory size, in kilobytes

S-process state. d= non-disruptive sleep status r= run s= sleep t= track/stop z= zombie Process

%cpu-percentage of CPU time that was last updated to current

Percentage of physical memory used by the%mem-process

Total CPU time used by the time+-process, Unit 1/100 sec

command-Process Name (command name/command line)

Third, Cat/proc/meminfo

memtotal:2052440 KB//Total Memorymemfree:50004 KB//Free memorybuffers:19976 KB//buffer size to filecached:436412 KB//Buffer memory (http://baike.baidu.com/view/496990.htm) size usedswapcached:19864 KB//Swap space size for cache storageactive:1144512 KB//cache memory paging file size in active useinactive:732788 KB//Infrequently used buffer memory paging file sizeActive (anon): 987640 KB//anon: SoonInactive (anon): 572512 KBActive (file): 156872 KBInactive (file): 160276 KBUnevictable:8 KBMlocked:8 KBhightotal:1177160 KB//the Total and free amount of memory, in kilobytes, that's not directly mapped into Kern El space.highfree:7396 KB//The Hightotal value can vary based on the type of kernel used.lowtotal:875280 KB//The total and free amount of memory, in kilobytes, that's directly mapped into kernel  Space. Used. lowfree:42608 KB//the lowtotal value can vary based on the type of kernelswaptotal:489940 KB//Swap space Total sizeswapfree:450328 KB//Free swap spacedirty:104 KB//Waits to be written back to the size of the diskwriteback:0 KB//size that is being written backanonpages:1408256 KB//Size of unmapped pagesmapped:131964 KB//size of device and file mappingsslab:37368 KB//Kernel data structure cache size to reduce the cost of requesting and freeing memorysreclaimable:14164 KB//recoverable slab sizesunreclaim:23204 KB//non-recoverable size of slab 23204+14164=37368pagetables:13308 KB//Managing the size of index tables for memory pagingnfs_unstable:0 KB//size of unstable page tablebounce:0 KB//bounce: Returnwritebacktmp:0 KB//commitlimit:1516160 KBcommitted_as:2511900 KBvmalloctotal:122880 KB//virtual memory sizevmallocused:28688 KB//virtual memory size already in usevmallocchunk:92204 KBhugepages_total:0//Large page assignmenthugepages_free:0hugepages_rsvd:0hugepages_surp:0hugepagesize:2048 KBdirectmap4k:10232 KBdirectmap2m:899072 KB

Iv. Gnome-system-monitor

A view tool that displays CPU, memory, swap, and network usage over the last period of time

Five, PS aux--sort-rss

A shows all processes on the terminal, including the processes of other users.
R shows only the running processes

X Show All programs, not the terminal to distinguish

Liu, Vmstat

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

Vii. KDE System Monitor

Linux check memory-free, top

Related Article

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.