zk-phi / symon

Tiny graphical system monitor
289 stars 26 forks source link

Factor in buffers and cache to memory usage #14

Closed gregsexton closed 9 years ago

gregsexton commented 9 years ago

The way you're calculating memory usage on linux is slightly misleading. This change will use the relatively new MemAvailable info if it is in /proc/meminfo otherwise we fall back to adding in buffers and cached (which is a technique that is a little outdated now but should give a more useful picture).

I quickly found these links which might help explain this, if you're unfamiliar.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 http://stackoverflow.com/questions/1460248/on-linux-how-should-i-calculate-the-amount-of-free-memory-from-the-information

zk-phi commented 9 years ago

merged, thanks for your contribution.

gregsexton commented 9 years ago

You're welcome. Thanks for the useful plugin.