How does Metricbeat define "Used Memory"?

I am considering using Metricbeat to track my server capacity, but I'm confused by the memory reports.

My test server has this output:

root@sandbox:/etc/metricbeat# free -m
              total        used        free      shared  buff/cache   available
Mem:           3947        1599        1508           6         840        2095
Swap:           765           0         765

Metricbeat shows my "Used Memory" as "2.364GB" I can't figure out where that number is coming from. It doesn't seem to correspond to anything reported by the "free" command.

What I'm interested in seeing is the amount of memory is available for use by my application. As shown above that is 2095MB aka 2.044GB.

So my questions are:
What is Metricbeat putting into the "system.memory.used.bytes" field?
How can I get the available memory, which should exclude memory used for Buffers and Cache?

See also http://www.linuxatemyram.com/

system.memory.used.bytes = MemTotal - MemFree where MemTotal and MemFree parsed from /proc/meminfo on Linux.

Metricbeat has system.memory.actual.free.bytes = MemFree + Buffers + Cached which is an estimation of the amount of available memory.

Okay thanks for the clairification. It seems like the differences are just small deltas due to methodology differences between metricbeat and /usr/bin/free. I expected the numbers to line up exactly, but it is fine if they are close enough.

The thing I mainly wanted to confirm is that "Available Memory" is the amount of memory which needs be used up before the system runs out of memory and invites that mean old "Out Of Memory Killer" to the party.

Or to put it another way:
system.memory.free - system.memory.actual.free = memory used by cache & buffers which will be tossed overboard in a low memory scenario

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.