From 02dfc664386426347b1cae90ff66e7a68cd90a5a Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Fri, 24 Aug 2018 02:22:11 +0200
Subject: [PATCH] gluon-status-page: update memory usage estimation

Let gluon-respondd expose "MemAvailable" from /proc/meminfo to allow for
a more realistic memory-usage estimation.

Information on MemAvailable can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
---
 package/gluon-status-page/javascript/status-page.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/gluon-status-page/javascript/status-page.js b/package/gluon-status-page/javascript/status-page.js
index fcd6fd950..e3405cf6c 100644
--- a/package/gluon-status-page/javascript/status-page.js
+++ b/package/gluon-status-page/javascript/status-page.js
@@ -74,7 +74,7 @@
 			return _['%s used'].sprintf(formatNumber(100 * value, 3) + '%');
 		},
 		'memory': function(memory) {
-			var usage = 1 - (memory.free + memory.buffers + memory.cached) / memory.total
+			var usage = 1 - memory.available / memory.total
 			return formats.percent(usage);
 		},
 		'time': function(seconds) {
-- 
GitLab