22

I can make sense of most of the information contained in /proc/meminfo like total memory, buffers, cache etc. Could you tell me what do the less obvious ones like the ones listed below mean?

  • AnonPages
  • Mapped
  • Slab
  • NFS_Unstable
  • Bounce
  • VmallocTotal
  • VmallocUsed
  • VmallocChunk

If anyone is wondering, I am talking about the output of the linux command cat /proc/meminfo

Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
AIB
  • 5,894
  • 8
  • 30
  • 36

3 Answers3

35

The canonical source of this information is /usr/src/linux/Documentation/filesystems/proc.txt. Specifically,

   AnonPages: Non-file backed pages mapped into userspace page tables
      Mapped: files which have been mmaped, such as libraries
        Slab: in-kernel data structures cache
NFS_Unstable: NFS pages sent to the server, but not yet committed to stable
        storage
      Bounce: Memory used for block device "bounce buffers"
VmallocTotal: total size of vmalloc memory area
 VmallocUsed: amount of vmalloc area which is used
VmallocChunk: largest contigious block of vmalloc area which is free
ephemient
  • 198,619
  • 38
  • 280
  • 391
  • alternate link while kernel.org is down: https://github.com/torvalds/linux/blob/master/Documentation/filesystems/proc.txt –  Sep 27 '11 at 17:36
  • That seems to also be down, so here's another mirror: https://www.kernel.org/doc/Documentation/filesystems/proc.txt – hfingler Apr 02 '20 at 21:07
16

My understanding is as follows.
And I agree these numbers are hard to understand and showing inconsistent values.

  • MemTotal

    = MemFree + Active + Inactive + Slab + PageTables + VmallocUsed + X
    (X : alloc_pages() (get_free_pages(), etc))
    

    But recent kernel's vmallocused value could be wrong. This is because it counts VM_xxx regions like VM_IOREMAP, VM_MAP,... other than VM_ALLOC area.

    VM_IOREMAP region can be mapping memory which can be outside of kernel's memory management, so the formula above can be not precise, or completely wrong.

    You can either do:

    • Check /proc/vmallocinfo to sort out all the entries and filter by yourself,
    • Modify fs/proc/mmu.c: get_vmalloc_info() to count regions only when if(vma->flags & VM_ALLOC)
  • Active + Inactive

     = Buffers + Cached + SwapCached + AnonPages
    
  • AnonPages

     = /proc/*/task/*/smaps anonymous area all sum
     (anonymous: no name|[heap]|/dev/zero|/dev/shm/*|[stack])
    

    Although I haven't been able to match these numbers. See here and help me if you have any clue.

  • Total PageCache

     = Buffers + Cached + SwapCached
    
  • Slab

     = SReclaimable + SUnreclaim
    
Community
  • 1
  • 1
holmes
  • 891
  • 8
  • 19
0

From RedHat

VMallocTotal — The total amount of memory, in kilobytes, of total allocated virtual address space. VMallocUsed — The total amount of memory, in kilobytes, of used virtual address space. VMallocChunk — The largest contiguous block of memory, in kilobytes, of available virtual address space.

Node
  • 21,706
  • 2
  • 31
  • 35
  • 2
    The VMallocUsed and VmallocChunk fields have been zeroed out since 4.4; see the commit to see why: https://github.com/torvalds/linux/commit/a5ad88ce8c7fae7ddc72ee49a11a75aa837788e0 – kaiwan Mar 12 '19 at 06:58