Linux/proc/meminfo file Analysis (reprint)

Source: Internet
Author: User

Cat/proc/meminfo read out the kernel information to explain,

The next article will simply analyze the code that reads the information.

#Cat/proc/meminfomemtotal:16438852Kbmemfree:10980184kbbuffers:95884kbcached:224108kbswapcached:0kbactive:5161616kbinactive:217660kbhightotal:0Kbhighfree:0kblowtotal:16438852Kblowfree:10980184kbswaptotal:1048536Kbswapfree:1048536Kbdirty:424Kbwriteback:0kbanonpages:5059312kbmapped:20424Kbslab:38176Kbpagetables:13480kbnfs_unstable:0kbbounce:0Kbcommitlimit:9267960kbcommitted_as:10073960kbvmalloctotal:34359738367kbvmallocused:263672Kbvmallocchunk:34359473751kbhugepages_total:0Hugepages_free:0HUGEPAGES_RSVD:0hugepagesize:2048Kb

memtotal: All available RAM sizes (that is, physical memory minus some reserved bits and the kernel's binary code size)

The sum of Memfree:lowfree and Highfree is left unused memory by the system.

Buffers: Used to buffer the file size

Cached: The size of the memory used by the cache memory (equal to DiskCache minus SwapCache).

Swapcached: The size of the swap space used by the cache memory has been swapped out of memory, but is still stored in the swapfile. Used to quickly be replaced when needed without having to open the I/O port again.

Active: The size of the buffer or buffer memory paging file in active use, unless it is necessary to be removed for his use.

Inactive: The size of the paging file in infrequently used buffers or cache memory may be used in other ways.

Hightotal:
Highfree: The zone is not mapped directly to the kernel space. The kernel must use this memory in a different manner.

Lowtotal:
Lowfree: Low can achieve the same effect as high memory, and it can be used by the kernel to record some of its own data structures. Among many
Other things, it's where everything from the Slab are
Allocated. Bad things happen if you ' re out of Lowmem.

Swaptotal: Total size of swap space

Swapfree: Size of swap space not used

Dirty: The amount of memory waiting to be written back to disk.

Writeback: The amount of memory that is being written back to disk.

Anonpages: Memory size of unmapped pages

Mapped: Size of mappings such as devices and files.

Slab: The size of the kernel data structure cache can reduce the consumption of application and release memory.

Sreclaimable: recoverable slab size

Sunreclaim: Size of Slab not recoverable (Sunreclaim+sreclaimable=slab)

Pagetables: The size of the index table that manages the paging page of memory.

Nfs_unstable: The size of an unstable page table

Bounce:

Commitlimit:based on the overcommit ratio (' vm.overcommit_ratio '),
This was the total amount of memory currently available to
Be allocated on the system. This limit was only adhered to
If strict Overcommit accounting is enabled (mode 2 in
' Vm.overcommit_memory ').
The commitlimit is calculated with the following formula:
Commitlimit = (' vm.overcommit_ratio ' * physical RAM) + Swap
For example, in a system with 1G of physical RAM and 7G
of swap with a ' vm.overcommit_ratio ' of the It would
Yield a commitlimit of 7.3G.
For more details, see the Memory Overcommit documentation
In Vm/overcommit-accounting.

Committed_as:the amount of memory presently allocated on the system.
The committed memory is a sum of all of the memory which
had been allocated by processes, even if it had not been
"Used" by them as of yet. A process which malloc () ' s 1G
of memory, but only touches 300M of it would only show up
As using 300M of memory even if it has the address space
Allocated for the entire 1G. This 1G was memory which has
Been "committed" to by the VM and can is used at any time
By the allocating application. With strict overcommit
Enabled on the system (Mode 2 in ' Vm.overcommit_memory '),
Allocations which would exceed the Commitlimit (detailed
above) won't be permitted. This is useful if one needs
To guarantee that processes won't fail due to lack of
Memory once that memory has been successfully allocated.

Vmalloctotal: Can vmalloc virtual memory size

Vmallocused: The size of the virtual memory that has been used.

Vmallocchunk:largest contigious block of Vmalloc area which are free

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

/proc/pid/status provides more easily understood stat and STATM information

# CAT/PROC/PID/STATM

654 57 44 0 0 334 0

Output interpretation
Man 5 proc, search STATM. From left to right, the contents are:

Size program Sizes
Resident resident Memory space size
Share Shared Memory Pages
Text snippet takes up memory pages
LIB Reference library occupies memory pages
Data/stack segments occupy memory pages
DT Number of dirty pages

# Cat/proc/pid/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

Linux/proc/meminfo file Analysis (reprint)

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.