

Here’s a snippet from proc/sysinfo.c, the code free uses to parse /proc/meminfo: This file provides much more detailed memory usage than Net-SNMP. Turns out free gets its information by parsing the /proc/meminfo file. So let’s see how free calculates “used” and see if that clears things up. If you believe free is providing the correct info, we’d assume either “Free” or “File Cache” to be about 12 GiB larger. As you can see in the screenshot below, the “Used” datapoint on the graph is calculated by subtracting “Free” and “File Cache” from “TotalReal” (The total amount of real/physical memory installed on this host). Let’s take a quick look at where the graph is getting its data, and how it is calculating “Used” space. A discrepancy of ~26.5 GiB is certainly worth further investigation. In this case, Net-SNMP says this system is using ~28 GB of memory, while free claims it’s only using ~1.5 GiB. Here’s one of the visualizations provided by LogicMonitor’s NetSNMPMem DataSource applied to a Linux system:īut wait! What does it mean when your monitoring system - which is most certainly polling Net-SNMP for memory info - disagrees with free. Or, better yet, you’ll just trust your monitoring system to do it for you. Although his blog focused on monitoring Linux Virtual memory, it turns out there’s some nuance in monitoring Physical memory as well.īecause you’re a Linux geek, you of course know that free is the tool you use to ask your kernel about how it’s using memory: It turns out he was right on the money (Steve’s a smart guy - who knew?).


Some time ago, our fearless (fearsome?) leader wrote a fine blog about the Right Way to Monitor Linux Virtual Memory.
