如何计算meminfo中的所有内存? [英] How do I account for all of the memory in meminfo?

查看:213
本文介绍了如何计算meminfo中的所有内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解meminfo如何跟踪内存.这是我在看的东西:

I'm trying to understand how meminfo tracks memory. Here's what I'm looking at:

MemTotal:         341596 kB
MemFree:          147288 kB
Buffers:              56 kB
Cached:            46752 kB
SwapCached:            0 kB
Active:            86928 kB
Inactive:          41384 kB
Active(anon):      81532 kB
Inactive(anon):      288 kB
Active(file):       5396 kB
Inactive(file):    41096 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         81532 kB
Mapped:            87648 kB
Shmem:               316 kB
Slab:              11568 kB
SReclaimable:       2580 kB
SUnreclaim:         8988 kB
KernelStack:        3232 kB
PageTables:         5480 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      170796 kB
Committed_AS:    2692436 kB
VmallocTotal:     327680 kB
VmallocUsed:       59244 kB
VmallocChunk:     259076 kB

这是我的问题:

1)如何计算所有341596kB的内存?显然147288是免费的.如何计算剩余的内存? (我的意思是没有写一个问题来解决零子集和的问题……)

1) How can I account for all 341596kB of memory? Clearly 147288 are free. How can I account for the remaining memory? (short of writing a problem to solve the zero-subset-sum problem, I mean...)

2)非活动/活动文件总内存为46492,而Mapped为87648.但是,根据

2) Total inactive/active file memory is 46492, but Mapped is 87648. But, according to the manual, it's

Mapped: files which have been mmaped, such as libraries

那么..与文件本身相比,怎么有更多的页面专用于映射文件?

so.. how could there be more pages devoted to mapped files than there are files themselves?

尽职调查我在SO上看到了其他帖子与该主题相关,但是没有一个可以解释如何在这里说明所有已用"内存...此外,我还发现了

Due diligence I've seen other posts on SO related to this subject, but none that explains how to account for all the "used" memory here... Also, I've found the Linux Kernel file explaining /proc/meminfo -- it just doesn't seem to have the complete information I want.

推荐答案

第757行是meminfo.

line 757 is meminfo.

请记住,缓冲区和缓存是灵活的.随着应用程序内存需求的增加,可以减少系统的缓存.

Remember that buffers and cache are flexible. Cache for the system can be reduced as memory requirements increase for apps.

这篇关于如何计算meminfo中的所有内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆