GNOME Bugzilla – Bug 727543
Use Linux 3.14.0 MemAvailable
Last modified: 2015-07-14 16:23:21 UTC
Created attachment 273527 [details] Set glibtop_mem::user to 'MemFree - MemAvailable' starting from Linux 3.14.0 Hello, a long time ago, when I added the member 'user' to the glibtop_mem struct, my intent was to supply a value that would represent the memory used by userspace. Before that, system-monitor was simply using 'used' and 'free' and because of the kernel caches, the memory usage was always reported > 90% which scared users (Windows Vista/7/etc lusers experienced the same misunderstanding years later). So back then, I added that 'user' member that would hide in libgtop/linux the 'free + cache + buffer' instead of the #ifdef __linux__ in system-monitor. Linux 3.14 now provides a "MemAvailable" field as described in https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/fs/proc/meminfo.c?id=34e431b0ae398fc54ea69ff85ec700722c9da773 which has a the same philosophy: provide a sensible number of how much memory is available to application. So please find attached a simple patch to computer 'user' as 'free - MemAvailable' for Linux >= 3.14. On my newly booted system, you can see the difference: Linux powerbook 3.14.0ben #1 SMP Thu Apr 3 09:17:44 CEST 2014 x86_64 GNU/Linux user new-style : 969MiB user old-style : 663MiB
Created attachment 274232 [details] [review] Use MemAvailable Same as a git patch.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
Review of attachment 274232 [details] [review]: Commited.