我可以理解/ proc/meminfo中包含的大部分信息,如总内存,缓冲区,缓存等.你能告诉我,下面列出的那些不太明显的是什么意思?
AnonPages
映射
板
NFS_Unstable
弹跳
VmallocTotal
VmallocUsed
VmallocChunk
如果有人想知道,我在谈论linux命令cat/proc/meminfo的输出
此信息的规范来源是/usr/src/linux/Documentation/filesystems/proc.txt.特别,
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
我的理解如下.
我同意这些数字很难理解并显示出不一致的价值观.
MemTotal
= MemFree + Active + Inactive + Slab + PageTables + VmallocUsed + X (X : alloc_pages() (get_free_pages(), etc))
但最近内核的vmallocused值可能是错误的.这是因为它计算VM_xxx区域,如VM_IOREMAP,VM_MAP,...而不是VM_ALLOC区域.
VM_IOREMAP区域可以映射内存,这可以在内核的内存管理之外,因此上面的公式可能不精确或完全错误.
你可以这样做:
检查/ proc/vmallocinfo以整理所有条目并自行过滤,
修改fs/proc/mmu.c:get_vmalloc_info()仅在if(vma-> flags&VM_ALLOC)时计算区域
有效+无效
= Buffers + Cached + SwapCached + AnonPages
AnonPages
= /proc/*/task/*/smaps anonymous area all sum (anonymous: no name|[heap]|/dev/zero|/dev/shm/*|[stack])
虽然我无法匹配这些数字.如果您有任何线索,请看这里并帮助我.
总PageCache
= Buffers + Cached + SwapCached
板
= SReclaimable + SUnreclaim