From 9d0f1a34a85e09a6265077e40370ccd0ff211f6b Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Sat, 23 Sep 2023 10:36:38 -0400 Subject: [PATCH] Use MemAvailable rather than MemFree (#914) 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 --- .../photonvision/common/hardware/metrics/cmds/LinuxCmds.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/photon-core/src/main/java/org/photonvision/common/hardware/metrics/cmds/LinuxCmds.java b/photon-core/src/main/java/org/photonvision/common/hardware/metrics/cmds/LinuxCmds.java index d151b22780..1a7d18f35e 100644 --- a/photon-core/src/main/java/org/photonvision/common/hardware/metrics/cmds/LinuxCmds.java +++ b/photon-core/src/main/java/org/photonvision/common/hardware/metrics/cmds/LinuxCmds.java @@ -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";