gpt4 book ai didi

ubuntu - MemFree 和 MemAvailable 之间的区别

转载 作者:太空宇宙 更新时间:2023-11-03 16:55:15 26 4
gpt4 key购买 nike

使用 Ubuntu 14.02 并运行命令 cat/proc/meminfo,我得到以下信息:

MemTotal:        1007796 kB
MemFree: 64248 kB
MemAvailable: 64876 kB

我想知道 MemFree 和 MemAvailable 之间的确切区别。此外,任何有关如何更有效地使用系统资源的提示都将不胜感激。我订购了一台新笔记本电脑,但目前,我正在一台配备 1Gb RAM 的机器上进行开发。

注意:我在执行命令时正在运行两个终端和 eclipse,所以你可以看到多任务处理是多么困难。

提前致谢。

最佳答案

Rik van Riel 的 comments when adding MemAvailable to /proc/meminfo :

/proc/meminfo: MemAvailable: provide estimated available memory

Many load balancing and workload placing programs check /proc/meminfoto estimate how much free memory is available. They generally do thisby adding up "free" and "cached", which was fine ten years ago, but ispretty much guaranteed to be wrong today.

It is wrong because Cached includes memory that is not freeable aspage cache, for example shared memory segments, tmpfs, and ramfs, andit does not include reclaimable slab memory, which can take up a largefraction of system memory on mostly idle systems with lots of files.

Currently, the amount of memory that is available for a new workload,without pushing the system into swap, can be estimated from MemFree,Active(file), Inactive(file), and SReclaimable, as well as the "low"watermarks from /proc/zoneinfo.

However, this may change in the future, and user space really shouldnot be expected to know kernel internals to come up with an estimatefor the amount of free memory.

It is more convenient to provide such an estimate in /proc/meminfo.If things change in the future, we only have to change it in oneplace.

关于ubuntu - MemFree 和 MemAvailable 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30869297/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com