/ proc / meminfo中的MemFree和MemAvailable有什么区别


45

如果您可能会看到类似这样的内容cat /proc/meminfo

MemTotal:        8078760 kB
MemFree:          629012 kB
MemAvailable:    1175568 kB
Buffers:          126184 kB
Cached:          2988512 kB
SwapCached:       261320 kB
Active:          4867796 kB
Inactive:        2119244 kB
Active(anon):    4465072 kB
Inactive(anon):  1895064 kB
Active(file):     402724 kB
Inactive(file):   224180 kB
Unevictable:       12068 kB
Mlocked:           12068 kB
SwapTotal:      16582652 kB
SwapFree:       13724816 kB
Dirty:               252 kB
Writeback:             0 kB
AnonPages:       3848816 kB
...

MemFree和MemAvailable有什么区别?

Answers:


55

TL; DR:

MemFree:系统未使用的物理RAM量(以千字节为单位)。

MemAvailable:估计无需启动即可启动新应用程序的可用内存量。根据MemFree,SReclaimable,文件LRU列表的大小以及每个区域中的低水位线计算得出。该估计考虑到系统需要一些页面缓存才能正常运行,并且由于正在使用项目,并非所有可回收的平板都将是可回收的。这些因素的影响因系统而异。

完整的答案就在这里:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.