I changed used memory calculation more pessimistic by using MemAvailable. Why I think it is better.
Reason 1:MemAvailable is “an estimate of how much memory is available for starting new applications, without swapping”. I think it is better metric.
Reason 2:MemAvailable was added to /proc/meminfo because using MemFree and Cached is not accurate. Quote from the commit to Linux kernel:
Many load balancing and workload placing programs check /proc/meminfo to estimate how much free memory is available. They generally do this by adding up "free" and "cached", which was fine ten years ago, but is pretty much guaranteed to be wrong today.
It is wrong because Cached includes memory that is not freeable as page cache, for example shared memory segments, tmpfs, and ramfs, and it does not include reclaimable slab memory, which can take up a large fraction of system memory on mostly idle systems with lots of files.
Reason 3: I tested this patch and now value is exactly what GNOME System Monitor is showing.
Closes https://github.com/elvetemedve/gnome-shell-extension-system-monitor/issues/77
I changed used memory calculation more pessimistic by using
MemAvailable
. Why I think it is better.Reason 1:
MemAvailable
is “an estimate of how much memory is available for starting new applications, without swapping”. I think it is better metric.Reason 2:
MemAvailable
was added to/proc/meminfo
because usingMemFree
andCached
is not accurate. Quote from the commit to Linux kernel:Reason 3: I tested this patch and now value is exactly what GNOME System Monitor is showing.