A server can look fine right up until MemFree hits zero, and that is when /proc/meminfo actually matters. This guide gives you a small set of read-only checks for RAM, reclaimable cache, swap and memory commitments, documented by Linux man-pages 6.7, installed here as package version 6.7-2, on a Linux 6.8.0-139-generic kernel. Allow about ten minutes. You need a shell and permission to read the proc filesystem; no root access is normally required.
/proc/meminfo is a live kernel interface, not a configuration file. Every read can produce different values, and some fields depend on kernel configuration. Treat the output as a current measurement rather than a record to edit or archive without a timestamp.
Read the first part of the file before writing a parser. Each line has a name, a colon, a number and, for the usual memory quantities, a unit such as kB:
$ command -v sed
/usr/bin/sed
$ sed -n '1,12p' /proc/meminfo
MemTotal: 32644620 kB
MemFree: 1094220 kB
MemAvailable: 19959140 kB
Buffers: 2018364 kB
Cached: 13645024 kB
SwapCached: 317976 kB
Active: 10970200 kB
Inactive: 13939420 kB
Active(anon): 8176872 kB
Inactive(anon): 2463420 kB
Active(file): 2793328 kB
The values above are host-specific. Do not compare the literal numbers with somebody else's machine. The names and meanings are the useful part, and new kernel releases can add fields. A parser should select names it understands and ignore the rest.
Checkpoint: Confirm that the file is readable and that the values you intend to use carry a unit:
$ test -r /proc/meminfo && echo readable
readable
$ awk '$1 == "MemTotal:" || $1 == "MemAvailable:" || $1 == "SwapFree:" {print}' /proc/meminfo
MemTotal: 32644620 kB
MemAvailable: 19959140 kB
SwapFree: 14920412 kB
MemTotal is usable physical RAM after a small amount is reserved for the kernel. MemFree is memory currently unused. It is usually the wrong question for an operational check because Linux can use otherwise idle RAM for caches. MemAvailable, present since Linux 3.14, is the kernel's estimate of memory that can be given to new applications without swapping.
Print the two fields together when deciding whether a host has room for a job:
$ awk '$1 == "MemTotal:" || $1 == "MemAvailable:" {printf "%-14s %12s %s\n", $1, $2, $3}' /proc/meminfo
MemTotal: 32644620 kB
MemAvailable: 19959140 kB
Keep the unit in reports. The manpage describes these values as kilobytes, written kB. Do not silently relabel the number as bytes, and do not assume that a field absent on one kernel should be treated as zero.
For a simple threshold, compare the numeric value in the file's unit. This example warns when less than 2,000,000 kB is available:
$ awk '$1 == "MemAvailable:" {if ($2 < 2000000) {print "low available memory: " $2 " " $3; exit 1} print "available memory is above 2000000 " $3}' /proc/meminfo
available memory is above 2000000 kB
The command's exit status is useful in a script. It is only a point-in-time check, so a successful result does not reserve memory for a later process.
Cached is the page cache for files read from disk and does not include SwapCached. Buffers is temporary storage for raw disk blocks. These values are not a direct measure of wasted RAM: the kernel can reclaim suitable cache under pressure. Active and Inactive describe recent use and reclaim eligibility, with the anonymous and file-backed variants giving more detail where available.
Inspect representative fields without adding them into a made-up "used memory" number:
$ awk '$1 ~ /^(MemTotal|MemFree|MemAvailable|Buffers|Cached|SReclaimable|SUnreclaim):$/ {printf "%-14s %12s %s\n", $1, $2, $3}' /proc/meminfo
MemTotal: 32644620 kB
MemFree: 1094220 kB
MemAvailable: 19959140 kB
Buffers: 2018364 kB
Cached: 13645024 kB
SReclaimable: 4894816 kB
SUnreclaim: 665940 kB
Your last two numbers will differ. SReclaimable is part of Slab that might be reclaimed, while SUnreclaim is the part that cannot be reclaimed under memory pressure. The field KReclaimable, available since Linux 4.20, includes SReclaimable plus other kernel allocations with a shrinker. Prefer the named field's documented meaning over a hand-built formula.
SwapTotal is available swap space and SwapFree is currently unused swap. The difference is space in use. SwapCached counts memory that was swapped out, brought back into RAM and still remains in the swap file, so it is not the same thing as current swap usage.
$ awk '$1 == "SwapTotal:" || $1 == "SwapFree:" || $1 == "SwapCached:" {printf "%-12s %12s %s\n", $1, $2, $3}' /proc/meminfo
SwapTotal: 16759804 kB
SwapFree: 14920412 kB
SwapCached: 317976 kB
$ awk '
$1 == "SwapTotal:" {total = $2; unit = $3}
$1 == "SwapFree:" {free = $2}
END {if (total >= free) printf "swap in use: %d %s\n", total - free, unit; else exit 1}
' /proc/meminfo
swap in use: 1839392 kB
Swap in use is a signal to investigate alongside MemAvailable, workload behaviour and I/O. It is not, by itself, proof that the host is currently thrashing. Do not disable swap or change its size as a reaction to one reading; those are system changes outside this read-only guide.
Committed_AS is memory promised by allocations, including address space that an application has reserved but not touched. It is not the same as resident RAM. CommitLimit is the allocation limit in kilobytes when strict overcommit accounting is enabled, which is mode 2 in /proc/sys/vm/overcommit_memory. The limit is calculated from the virtual-memory settings described by that interface.
$ awk '$1 == "CommitLimit:" || $1 == "Committed_AS:" {printf "%-14s %12s %s\n", $1, $2, $3}' /proc/meminfo
CommitLimit: 33082112 kB
Committed_AS: 47679784 kB
A Committed_AS value above CommitLimit is not automatically an error on a host using a different overcommit mode. Read the mode before interpreting the pair:
$ cat /proc/sys/vm/overcommit_memory
0
Mode 0 is heuristic overcommit, not strict mode 2. This file is readable here, but virtual-memory policy files can be restricted by permissions or containers. If you only need a capacity check for starting work, use MemAvailable and leave commit accounting for diagnosing allocation policy.
Some entries appear only when the kernel has the relevant feature configured. Huge-page, CMA, high-memory and transparent-huge-page fields are examples. A missing optional field is different from a field whose value is zero. Use a name-based lookup and make the absence visible:
$ awk '$1 == "HugePages_Total:" {found=1; print; exit} END {if (!found) print "HugePages_Total: unavailable on this kernel"}' /proc/meminfo
HugePages_Total: 0
Read the file once per measurement. Separate commands can observe different moments, which can make a hand-calculated total internally inconsistent. For a log, capture a timestamp and the selected lines together:
$ date --iso-8601=seconds
2026-09-26T00:00:00+01:00
$ awk '$1 ~ /^(MemAvailable|SwapTotal|SwapFree):$/ {print}' /proc/meminfo
MemAvailable: 19958632 kB
SwapTotal: 16759804 kB
SwapFree: 14920412 kB
The timestamp above is an example shape, not a value to copy into a report. If a container shows unusual totals, remember that procfs visibility and the host kernel's accounting can differ from what you expect. Compare with the same environment in which the workload runs.
/proc/meminfo was read without elevated privileges or file changes.MemAvailable was used for a capacity check instead of treating MemFree as all usable RAM.kB unit and were not confused with bytes.