diff options
author | Aaron Ball <nullspoon@oper.io> | 2021-06-01 10:32:50 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2021-06-01 10:32:50 -0600 |
commit | f21b4fcad43b147c3420e3976b8090a05d40dd2e (patch) | |
tree | df7eac2a077c29ba243d141bf0b4e9fcfe3bd27f | |
parent | 20c4cb38deea90d16a975d4a1382db863177e8ad (diff) | |
download | i3cstat-f21b4fcad43b147c3420e3976b8090a05d40dd2e.tar.gz i3cstat-f21b4fcad43b147c3420e3976b8090a05d40dd2e.tar.xz |
Fix memory calculations
Subtract bufferram also from totalram to better calculate used ram
(since buffer is fluid and doesn't represend actually "used" memory).
-rw-r--r-- | src/config_mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config_mem.c b/src/config_mem.c index d579eac..2fbc32f 100644 --- a/src/config_mem.c +++ b/src/config_mem.c @@ -33,7 +33,7 @@ int config_mem_load(struct node* n) { int percent; sysinfo(&si); - used = si.totalram - si.freeram; + used = si.totalram - si.freeram - si.bufferram; percent = used * 100 / si.totalram; if(percent < 20) { |