Skip to content

Memory utilization alerts that don't false-positive

Most memory alerts fire on the wrong metric. Here is how Linux really uses memory and which signals actually mean something on a production host.

A page that says “memory usage at 92%” on a Linux host is, most of the time, telling you nothing. Linux uses free memory for caches because unused memory is wasted memory. The kernel will hand it back the moment an application asks. Yet “memory > 90%” is still the default threshold shipped with most monitoring agents, which is why on-call gets paged for a host that is perfectly healthy.

What’s happening

used memory in free -m includes the page cache. A database server with 64 GB of RAM and a large dataset will appear to be at 95% memory utilization within hours of starting — because the kernel has aggressively populated the page cache with hot pages. This is the correct behavior. Alerting on it is wrong.

The signals that actually matter are different:

  • MemAvailable (in /proc/meminfo) is the kernel’s own estimate of how much memory could be made available for a new allocation without swapping. This is the metric to alert on, not MemFree or “used percentage.”
  • Swap activity, specifically pgswpin and pgswpout rates from /proc/vmstat. Steady swap activity on a server with swap configured means the working set no longer fits in RAM. Steady swap activity on a server without swap means you’re about to meet the OOM killer.
  • OOM kill events in the kernel log (dmesg | grep -i oom). Any non-zero rate here is an actual problem, not a percentage threshold.

How to verify

Pull the four numbers from a real host:

grep -E 'MemTotal|MemFree|MemAvailable|SwapFree' /proc/meminfo
vmstat 1 5
dmesg -T | grep -i 'killed process' | tail

If MemAvailable is comfortably above 10% of MemTotal and vmstat shows si/so columns at zero, the host is fine — regardless of what “used percentage” your dashboard shows. If MemAvailable is dropping over hours and si/so are non-zero, you have a real memory pressure event. If dmesg shows OOM kills, something has already been killed; that is the alert worth firing.

For application-level memory leaks (a slow climb that doesn’t release), the metric is the resident set of the process itself over time — ps -o pid,rss,cmd snapshotted on an interval — not the host-level percentage.

The fix

Alert on MemAvailable < 10% sustained for 10 minutes, on any non-zero sustained si/so rate, and on any OOM kill event. Drop the “memory > 90%” alert entirely. For specific processes (PHP-FPM, MySQL, JVMs) track per-process RSS and alert on per-process growth trends, not host-level aggregates.


Stack Harbor’s Monitoring & Support practice replaces default-template alerts with workload-specific ones as standard onboarding. If your pager fires on memory but you never act on it, we can fix that — or see how monitoring fits with environment management.