wmmemload: Use MemAvailable from kernel > v3.14 to display memory usage
commitbd0d7d1f67b5a4f7ba2eeb94224a10f949517c1a
authorCarlos R. Mafra <crmafra@gmail.com>
Sat, 12 Jan 2019 21:55:02 +0000 (12 21:55 +0000)
committerCarlos R. Mafra <crmafra@gmail.com>
Sat, 12 Jan 2019 22:05:06 +0000 (12 22:05 +0000)
tree950806e5ee05ebcdfdb8507c5f642cd1cab8176d
parent774e4f769fa649a98edec3876443defa8239a50d
wmmemload: Use MemAvailable from kernel > v3.14 to display memory usage

After the introduction of MemAvailable in the kernel v3.14 one can
estimate how much RAM memory is being "used" by how much it is left
before the system starts swapping.

That is the reason why I want to monitor memory usage, to know
how close the system is to swapping. Therefore I propose to
use MemAvailable to compute the percentage of "used" memory.
Theoretically, after this patch a 100% memory usage is a more
accurate description of "yeah, we need to swap from now on".

See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
wmmemload/src/mem_linux.c