Skip to content

Commit

Permalink
Use MemAvailable rather than MemFree (#914)
Browse files Browse the repository at this point in the history
Fixes linux metrics reporting to report mem free before swap starts, instead of physical unused ram
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
  • Loading branch information
rzblue committed Sep 23, 2023
1 parent 7f28364 commit 9d0f1a3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void initCmds(HardwareConfig config) {
cpuUptimeCommand = "uptime -p | cut -c 4-";

// RAM
ramUsageCommand = "awk '/MemFree:/ {print int($2 / 1000);}' /proc/meminfo";
ramUsageCommand = "awk '/MemAvailable:/ {print int($2 / 1000);}' /proc/meminfo";

// Disk
diskUsageCommand = "df ./ --output=pcent | tail -n +2";
Expand Down

0 comments on commit 9d0f1a3

Please sign in to comment.