Linux View memory consumption command parsing

Source: Internet
Author: User

$cat/proc/meminfo
memtotal:2052440 KB//Total Memory
memfree:50004 KB//Free memory
buffers:19976 KB//buffer size to file
cached:436412 KB//Buffer memory (http://baike.baidu.com/view/496990.htm) size used
swapcached:19864 KB//Swap space size for cache storage
active:1144512 KB//cache memory paging file size in active use
inactive:732788 KB//Infrequently used buffer memory paging file size
Active (anon): 987640 KB//anon: Soon
Inactive (anon): 572512 KB
Active (file): 156872 KB
Inactive (file): 160276 KB
Unevictable:8 KB
Mlocked:8 KB
hightotal: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 kernel
swaptotal:489940 KB//Swap space Total size
swapfree:450328 KB//Free swap space
dirty:104 KB//Waits to be written back to the size of the disk
writeback:0 KB//size that is being written back
anonpages:1408256 KB//Size of unmapped pages
mapped:131964 KB//size of device and file mappings
slab:37368 KB//Kernel data structure cache size to reduce the cost of requesting and freeing memory
sreclaimable:14164 KB//recoverable slab size
sunreclaim:23204 KB//non-recoverable size of slab 23204+14164=37368
pagetables:13308 KB//Managing the size of index tables for memory paging
nfs_unstable:0 KB//size of unstable page table
bounce:0 KB//bounce: Return
writebacktmp:0 KB//
commitlimit:1516160 KB
committed_as:2511900 KB
vmalloctotal:122880 KB//virtual memory size
vmallocused:28688 KB//virtual memory size already in use
vmallocchunk:92204 KB
hugepages_total:0//Large page assignment
hugepages_free:0
hugepages_rsvd:0
hugepages_surp:0
hugepagesize:2048 KB
directmap4k:10232 KB
directmap2m:899072 KB


Use Df-h (you can also view memory usage occupancy)

Sometimes the utilization of Linux memory reaches 99%.

Nmon's surveillance revealed the presence of 5.6G of cached memory, described below:

Unlike Windows, Linux has cache memory, which is often called cache memories. There are times when you find that there are no programs running, but using the top or the free command to see the available memory is rare.

What is cache memory (cached RAM):

When you read and write files, the Linux kernel caches the files in memory for increased read and write efficiency and speed, which is the cache memory. The Cache memory will not be released automatically even after your program has finished running. This will cause you to read and write files frequently in your Linux system, and you will find that there is little physical memory available.

In fact, this cache memory is automatically released when you need to use memory, so you don't have to worry about not having memory available. If you want to release the cache memory manually, there is a way.

Release the cache memory (cached):

Use the following command to release the cache Memory:

[[Email protected]~] #echo 3 >/proc/sys/vm/drop_caches

How to free cache memory in Linux

Because of the kernel mechanism of Linux, it is generally not necessary to deliberately release the cache that is already in use. These cache contents can increase the file and read and write speed.


To view memory usage for the first 10 processes:

PS Aux|head-1; PS aux | Sort-k4nr | Head-10

This article from the "32 Krypton" blog, reproduced please contact the author!

Linux View memory consumption command parsing

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.