/proc/meminfo explanation =/nmon Analysis--mem

Source: Internet
Author: User

Memtotal Hightotal Lowtotal Swaptotal Memfree Highfree Lowfree Swapfree Memshared Cached Active Bigfree Buffers Swapcached Inactive

/proc/meminfo Details(2010-10-13 04:10:22) reproduced
Tags: gossip Category: Linux
$cat/proc/meminfomemtotal:        2052440 KB//Total memory Memfree:           50004 K B//Free memory buffers:           19976 KB//buffer size to file cached:           436412 K B//cache memory (http://baike.baidu.com/view/496990.htm) used size swapcached:        19864 KB// Swap space size for cache storage active:          1144512 KB//active in-use cache paging file size inactive:       & nbsp 732788 KB//infrequently used buffer memory paging file size Active (anon):     987640 KB//anon: Soon inactive (anon):   572512 kbactive ( File):     156872 kbinactive (file):   160276 kbunevictable:           8 kbmlocked:               8 kbhightotal:       1177160 KB//the Total and free Amou NT of memory, in kilobytes, that's not directly mapped into kernel 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, which is directly map PED into kernel space.  used. lowfree:           42608 KB//the lowtotal value can vary based on the type of K Ernelswaptotal:        489940 kb//Swap space Total size swapfree:         450328 KB//Free swap space dirt Y:               104 KB//wait to be written back to disk size writeback:           &NBS P 0 KB//size being written back anonpages:       1408256 kb//size of unmapped pages mapped:           131964 KB/ /device and file mapping size slab:              37368 KB//Kernel data structure cache size to reduce the consumption of application and release memory Sreclaimable: & nbsp    14164 KB//recoverable slab size Sunreclaim:        23204 KB//non-recoverable slab size 23204+14164= 37368PageTables:        13308 KB//Manage the size of the index table for memory paging nfs_unstable:          0 kb//Unstable page table size bounce:                0 KB//bounce: Return to Writebacktmp:          0 KB//commitlimit:     1516160 kbcommitted_as:    2511900 Kbvmalloc Total:     122880 KB//Virtual memory size vmallocused:       28688 KB//virtual memory size already in use Vmallocchunk:   &NBSP ;  92204 kbhugepages_total:       0//Large page assignment Hugepages_free:        0HUGEPAGES_RSVD :        0HUGEPAGES_SURP:        0hugepagesize:       2048 kbdirect MAP4K:       10232 kbdirectmap2m:      899072 KB/proc/meminfo Detailed/proc/meminfo explained

"Free," "Buffer," "Swap," "dirty." What is does it all mean? If Yousaid, "something to does with the Summer of ' the '" ", you may need a Primeron ' meminfo '.

The entries in The/proc/meminfo can help explain what's going on with your memory usage, if you know how to read it.

Example of "Cat/proc/meminfo":

Root: Total    :        used: Free        :          shared:    buffers:    Cached:
Mem: 1055760384 1041887232 13873152 0 100417536 711233536
Swap: 1077501952 8540160 1068961792
Memtotal:        1031016 KB    
Memfree: 13548 KB
Memshared: 0 KB
Buffers: 98064 KB
Cached: 692320 KB
swapcached: 2244 KB
Active: 563112 KB
Inact_dirty: 309584 KB
Inact_clean: 79508 KB
Inact_target: 190440 KB
Hightotal: 130992 KB
Highfree: 1876 KB
Lowtotal: 900024 KB
Lowfree: 11672 KB
Swaptotal: 1052248 KB
Swapfree: 1043908 KB
Committed_as: 332340 KB

The information comes in the form of both high-level and low-level statistics. At the top of your see a quick summary of the most common values people would like to look at. Below you find the individual values we'll discuss. First we'll discuss the high-level statistics.

High-level Statistics
    • memtotal : Total usable ram (i.e. physical RAM Minus a few reserved bits and the kernel binary code)
    • memfree : Is sum of lowfree+highfree (overall stat)
    • memshared : 0; Is here for compat reasons but always zero.
    • buffers : Memory in buffer cache. Mostly useless as Metric nowadays
    • Cached : Memory in the Pagecache ( DiskCache) minus SwapCache
    • SwapCache : Memory that Once was swapped out, are swapped back on but still also are in the Swapfile (if memory are needed it doesn ' t need to be swap PED out AGAIN because it's already in the Swapfile. This saves I/O)
Detailed Level Statistics
VM Statistics

VM splits the cache pages into "active" and "inactive" memory. Theidea is so if you need memory and some the cache needs to being sacrificedfor that, the it from inactive since that ' s E Xpected to be notused. The VM checks what's used on a regular basis and moves stuffaround.

When your use memory, the CPU sets a bit in the pagetable and the vmchecks that bit occasionally, and based on that, it can Move pages Backto active. And within active there ' s an order of "longest ago not used" (roughly, it's a little more complex in reality). The Longest-ago Usedones can get moved to inactive. Inactive is split into the Abovekernel (2.4.18-24.8.0). Some has it three.

  • Active: Memory that have been used more recently and usually not reclaimed unless absolutely necessary.
  • inact_dirty: Dirty means "might need writing to disk Orswap." Takes more work to free. Examples might is files that has notbeen written to yet. They aren ' t written to memory too soon in order tokeep the I/O down. For instance, if your ' re writing logs, it might bebetter to wait until you have a complete log ready before sending it Todi Sk.
  • Inact_clean: assumed to be easily freeable. The kernel would try to keep some clean stuff around always has a bit of breathing.
  • inact_target: Just A goal metric the kernel uses formaking sure there are enough inactive pages around. When exceeded, Thekernel'll not does work to move pages from active to inactive. A pagecan also get inactive in a few other ways, e.g. if you do a longsequential I/O, the kernel assumes you ' re not going To use that Memoryand makes it inactive preventively. So your can get more inactive Pagesthan the target because the kernel marks some cache as "more likely tobe never used" and Lets it cheat in the ' last used ' order.
Memory Statistics
  • hightotal: Is the total amount of memory in the. Highmem is all memory above (approx) 860MB of physical RAM. Kernel Usesindirect tricks to access the high memory region. Data cache can go inthis memory region.
  • lowtotal: The total amount of non-highmem memory.
  • lowfree: The amount of free memory for the low memoryregion. This is the memory the kernel can address directly. All kerneldatastructures need to go into the low memory.
  • swaptotal: Total amount of physical swap memory.
  • swapfree: Total amount of swap memory free.
  • committed_as: An estimate of what much RAM you wouldneed to make a 99.99% guarantee that there never are OOM (out O F memory) for this workload. Normally the kernel would overcommit memory. Thatmeans, say you did a 1GB malloc, nothing happens, really. Only if Youstart USING that malloc memory you'll get real memory on demand, andjust as much as you use. So you sort of take a mortgage and hope Thebank doesn ' t go bust. Other cases might include when you mmap a filethat ' s gkfx only if you write to it and you get a private copy ofthat da Ta. While the it normally is shared between processes. Thecommitted_as is a guesstimate of what much ram/swap you would needworst-case.

Look at the memory under Linux we generally use the free command:
[[email protected] tmp]# free
              total       used       free     shared    buffers      cached
mem:       3266180    3250004       16176          0     110652    2668236
-/+ buffers/cache:     471116    2795064
swap:      2048276      80160    1968116

Here is an explanation of these values:
Total: The amount of physical memory.
Used: How large is used.
Free: How much is available.
Shared: The total amount of memory shared by multiple processes.
Buffers/cached: The size of the disk cache.
Third line (-/+ buffers/cached):
Used: How large is used.
Free: How much is available.
There is not much to explain in line four.
Difference: The used/free of the second line (MEM) differs from the third row (-/+ Buffers/cache) used/free. The difference between the two is that the first line is from the OS point of view, because for the os,buffers/cached are all belong to be used, so his available memory is 16176KB, the used memory is 3250004KB, which includes, the kernel (OS) uses + The +buffers+cached used by Application (X,ORACLE,ETC).
The third line refers to the application from the point of view, buffers/cached is equal to the availability of the application, because buffer/cached is to improve the performance of the file read, when the application needs to use memory, buffer/cached will be quickly recycled.
So from the application's point of view, available memory = System Free memory+buffers+cached.
As in the above example:
2795064=16176+110652+2668236

Next, explain when the memory will be exchanged, and by what side. When the available memory is less than the rated value, a meeting is exchanged.
How to see the rating:
Cat/proc/meminfo

[Email protected] tmp]# Cat/proc/meminfo
memtotal:3266180 KB
memfree:17456 KB
buffers:111328 KB
cached:2664024 KB
swapcached:0 KB
active:467236 KB
inactive:2644928 KB
hightotal:0 KB
highfree:0 KB
lowtotal:3266180 KB
lowfree:17456 KB
swaptotal:2048276 KB
swapfree:1968116 KB
Dirty:8 KB
writeback:0 KB
mapped:345360 KB
slab:112344 KB
committed_as:535292 KB
pagetables:2340 KB
vmalloctotal:536870911 KB
vmallocused:272696 KB
vmallocchunk:536598175 KB
hugepages_total:0
hugepages_free:0
hugepagesize:2048 KB

Results viewed with free-m:
[Email protected] tmp]# free-m
Total used free shared buffers Cached
mem:3189 3173 16 0 107 2605
-/+ buffers/cache:460 2729
swap:2000 78 1921


To view the size of the/proc/kcore file (memory image):
[Email protected] tmp]# ll-h/proc/kcore
-R--------1 root root 4.1G June 12:04/proc/kcore

Note:

Memory-intensive measurements

To measure how much memory a process consumes, Linux provides a convenient way for us to provide all the information we have in the/proc directory, and in fact the top tools are also available here to obtain the appropriate information.

Memory usage information for/proc/meminfo machines

The/proc/pid/maps PID is the process number that displays the virtual address occupied by the current process.

Memory occupied by the/PROC/PID/STATM process

[Email protected] ~]# CAT/PROC/SELF/STATM

654 57 44 0 0 334 0

Output interpretation

CPU and CPU0 ... The meaning of each parameter of each row (in the first example) is:

Parameter Interpretation/proc//status

Size (pages) task virtual address space VMSIZE/4

Resident (pages) the size of the physical memory that the application is using VMRSS/4

Shared (pages) pages 0

The size of the executable virtual memory owned by the TRS (pages) program VMEXE/4

The size of the library in which Lrs (pages) is imaged into the virtual memory space of the task VMLIB/4

Drs (pages) program data segment and user-state stack size (vmdata+ VMSTK) 4

DT (pages) 04

View Machine available memory

/proc/28248/>free

Total used free shared buffers Cached

mem:1023788 926400 97388 0 134668 503688

-/+ buffers/cache:288044 735744

swap:1959920 89608 1870312

When we look at the idle memory of the machine with the free command, we find that the value of the. This is mainly because, in Linux there is such a thought, the memory is not white, so it as far as possible cache and buffer some data to facilitate the next use. But in fact, the memory is also available for immediate use.

So free memory =free+buffers+cached=total-used

Transferred from: http://blog.chinaunix.net/u2/78225/showart_1727609.html

/proc/meminfo explanation =/nmon Analysis--mem

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.