Use it when a system swaps, processes are killed by the OOM killer, or memory seems to disappear.
Memory
Memory monitoring shows used, free, buffers/cache and available memory, swap use and per-process memory (RSS). Linux uses free RAM as cache, so "free" is usually low; "available" is what matters.
1. free -h — available memory?
2. vmstat 1 — si/so non-zero continuously?
3. ps aux --sort=-rss | head — biggest processes.
4. OOM kills: journalctl -k | grep -i 'out of memory'.
5. Leak → watch the process's RSS over time.
memory used by processes and cache → available falls → swapping → OOM killer as last resort
For Resource Monitoring → Memory, continue with the first unproven Topic check: Record total/available memory, swap, workload/cgroup limits and a baseline at the incident time. If that boundary is healthy, advance to the adjacent check: Sample reclaim, page faults, swap-in/out, slab/cache and memory-pressure indicators over time rather than relying on one snapshot. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
process/cgroup allocations → page cache/anonymous/slab working set → reclaim + faults → swap or OOM decision → process/service effect → workload acceptance
Healthy evidence: available memory and reclaim remain stable for the workload, swap activity is bounded, no OOM events occur, and process/cgroup working sets behave within expected limits.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Record total/available memory, swap, workload/cgroup limits and a baseline at the incident time.
- Sample reclaim, page faults, swap-in/out, slab/cache and memory-pressure indicators over time rather than relying on one snapshot.
- Attribute RSS/PSS or cgroup growth and inspect OOM/kernel logs to distinguish leak, working-set growth, reclaim pressure and configured limits.
- Apply one cause-specific change, rerun the original workload and confirm available-memory/reclaim behavior plus application latency/stability recover.
Verification chain. process/cgroup allocations → page cache/anonymous/slab working set → reclaim + faults → swap or OOM decision → process/service effect → workload acceptance
Step 3 Commands Verify boundary
free -h
cat /proc/meminfo | grep -E 'MemAvailable|Swap'
vmstat 1 5
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: available memory collapses with sustained reclaim, major faults or swap activity, cgroup limits throttle/kill workloads, slab or anonymous memory grows unexpectedly, or OOM events align with failures.
Step 5 Common mistakes Narrow the fault
- Using
free's "free" column instead of "available".
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Check available in free -h, not free. Steady swap-in/out (si/so in vmstat) means real memory pressure. OOM kills are logged by the kernel (journalctl -k | grep -i oom). Growing RSS over days points to a leak.
top -o %CPU / htop— live CPU and memory per processvmstat 1 5— CPU, memory, swap and I/O over timefree -h— memory and swapiostat -xz 1 3— disk utilisation and latency (sysstat)uptime— load averages
ReferenceWhat it is1 section · depth on demand
Core model
Capture total/available memory, cache, anonymous and slab state, swap usage and VM activity across the incident window. Distinguish healthy cache use from reclaim pressure, inspect major faults, swap-in/out, PSI or OOM/killer evidence, and attribute growth to processes/cgroups before changing caches, swap or limits.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
Memory pressure is confirmed only when reclaim, faulting, swap, PSI/OOM or limit evidence is correlated with the workload and attributed to the relevant process/cgroup; low free RAM alone is not evidence.
In depth
Memory: what "used" really means
Linux uses free memory as file cache, so "free" is almost always low on a healthy system. The figure that matters is how much memory is available. The proc_meminfo(5) manual page defines the important fields:
| Field | Meaning |
|---|---|
| MemTotal | Usable RAM |
| MemFree | Completely unused memory |
| MemAvailable | Estimate of memory available for new applications without swapping |
| Buffers, Cached | Raw disk block buffers; the page cache for file data |
| Dirty, Writeback | Data waiting to be written / being written |
| Shmem | tmpfs, shared memory and shared anonymous mappings |
| Slab, SReclaimable | Kernel object caches, and the reclaimable part |
| Committed_AS / CommitLimit | Memory promised to processes / the limit under strict overcommit |
| HugePages_Total / Free | The huge page pool |
The free(1) manual page explains its columns in the same terms. "used" is total minus available. "available" is the estimate above, and "shared" is mostly tmpfs.
Signs of real memory pressure
| Sign | Command |
|---|---|
| Low MemAvailable relative to the workload | free -h |
| Swap-in and swap-out activity (not just used swap) | vmstat 1 (si, so) |
| Pressure stalls | /proc/pressure/memory |
| OOM kills | dmesg | grep -i "killed process", journalctl -k -g oom |
| Major page faults | sar -B 1, pidstat -r 1 |
Finding who uses memory
| Question | Command |
|---|---|
| Largest processes by resident memory | ps -eo pid,rss,comm --sort=-rss | head |
| Proportional use, including shared pages | smem -rk |
| Per service | systemd-cgtop -m, systemctl status <unit> (Memory:) |
| Kernel memory | slabtop -o | head |
| tmpfs usage | df -h -t tmpfs |
host$ free -h
total used free shared buff/cache available
Mem: 31Gi 12Gi 598Mi 1.1Gi 18Gi 19Gi
Swap: 8.0Gi 1.9Mi 8.0Gi
host$ grep -E "^(MemAvailable|Dirty|Shmem|SReclaimable|Committed_AS|CommitLimit):" /proc/meminfo
host$ journalctl -k -g "Out of memory|oom-kill" -b --no-pager | tail -2
kernel: Out of memory: Killed process 22011 (java) total-vm:14882136kB, anon-rss:9212340kB, file-rss:0kB
host$ systemd-cgtop -m -n 1 | head -6
host$ ps -eo pid,rss,comm --sort=-rss | head -4
Reading free
Only 598 MiB is "free", but 19 GiB is available, because most of the rest is file cache the kernel can drop at once. This system isn't short of memory now. The OOM kill in the log happened earlier, and the anon-rss figure shows the Java process grew to 9 GB. Set a heap limit, or a memory limit on its unit.
Documented example, not captured output.
How it works at runtime
Memory is part of Resource Monitoring → Memory. Memory monitoring interprets Linux virtual-memory state through available memory, page cache, anonymous memory, reclaim, swap, faults, pressure and OOM evidence instead of treating the free-memory number as the health signal.
Topic-specific state model. Memory monitoring interprets Linux virtual-memory state through available memory, page cache, anonymous memory, reclaim, swap, faults, pressure and OOM evidence instead of treating the free-memory number as the health signal.
Interpretation rule. - Low free memory ≠ memory exhaustion; Linux intentionally uses RAM for cache.
- Swap in use ≠ current swapping or active performance pressure.
- An OOM-killed process ≠ evidence that the killed process caused the memory pressure.
- Dropping caches creates free pages ≠ it fixes a leak, limit or sustained working-set problem.
Quick reference
Memory monitoring:
free -h
vmstat 1 5 # si/so swap activity, free/buff/cache
cat /proc/meminfo | egrep 'MemAvailable|Cached|Dirty|Writeback|Slab|SwapTotal|SwapFree|Committed_AS'
ps -eo pid,rss,cmd --sort=-rss | head
smem -rtk | head
cat /proc/pressure/memory
systemd-cgtop -m # memory per cgroup/service
MemAvailable estimates memory usable without swapping. Rising Committed_AS far above RAM indicates overcommit risk; vm.overcommit_memory controls the policy.
Limits and how it fails
Primary failure point. Memory pressure is confirmed only when reclaim, faulting, swap, PSI/OOM or limit evidence is correlated with the workload and attributed to the relevant process/cgroup; low free RAM alone is not evidence.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Memory owns Linux host virtual-memory observation. Processes/cgroups own per-process or limit context; kernel hardware owns low-level memory/kernel faults; applications own heap-specific profiling.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Resource Monitoring → Memory. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://gitlab.com/procps-ng/procps · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Memory operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Memory.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Memory monitoring interprets Linux virtual-memory state through available memory, page cache, anonymous memory, reclaim, swap, faults, pressure and OOM evidence instead of treating the free-memory number as the health signal. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin exact symptom + interval → identify host/VM, workload and authoritative kernel/device/resource scope → capture correlated runtime telemetry/state → attribute the abnormal signal to process/cgroup/device/driver → find first failed boundary → change one demonstrated cause → read back effective state → repeat original workload + regression check. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | process/cgroup allocations → page cache/anonymous/slab working set → reclaim + faults → swap or OOM decision → process/service effect → workload acceptance | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Memory pressure is proven only when reclaim, faulting, swap, PSI/OOM or limit evidence is correlated with the workload and attributed to the relevant process/cgroup; low free RAM alone is not proof. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux resource/kernel evidence can establish this proof path: process/cgroup allocations → page cache/anonymous/slab working set → reclaim + faults → swap or OOM decision → process/service effect → workload acceptance | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured host/VM, boot, incident interval, namespace/cgroup, process, device, kernel/driver or workload scope. Memory pressure is proven only when reclaim, faulting, swap, PSI/OOM or limit evidence is correlated with the workload and attributed to the relevant process/cgroup; low free RAM alone is not proof. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven resource/kernel boundary: preserve the exact incident scope, capture the adjacent process/cgroup/device/driver or subsystem state, change only the demonstrated cause, then repeat the original workload and regression checks. | Continue to the next unresolved boundary while preserving the original test condition. |
Memory · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Memory |
|---|---|
| Topic path | Resource Monitoring → Memory |
| Runtime state | Memory monitoring interprets Linux virtual-memory state through available memory, page cache, anonymous memory, reclaim, swap, faults, pressure and OOM evidence instead of treating the free-memory number as the health signal. |
| Fast checks | - Record total/available memory, swap, workload/cgroup limits and a baseline at the incident time. - Sample reclaim, page faults, swap-in/out, slab/cache and memory-pressure indicators over time rather than relying on one snapshot. - Attribute RSS/PSS or cgroup growth and inspect OOM/kernel logs to distinguish leak, working-set growth, reclaim pressure and configured limits. - Apply one cause-specific change, rerun the original workload and confirm available-memory/reclaim behavior plus application latency/stability recover. |
| Verification chain | process/cgroup allocations → page cache/anonymous/slab working set → reclaim + faults → swap or OOM decision → process/service effect → workload acceptance Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary. |
| Failure boundary | Memory pressure is proven only when reclaim, faulting, swap, PSI/OOM or limit evidence is correlated with the workload and attributed to the relevant process/cgroup; low free RAM alone is not proof. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |