Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Memory

Direct answer

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.

When to use this

Use it when a system swaps, processes are killed by the OOM killer, or memory seems to disappear.

First 30 seconds

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.

Operational verification

memory used by processes and cache → available falls → swapping → OOM killer as last resort

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it when a system swaps, processes are killed by the OOM killer, or memory seems to disappear.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points

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.

Key checks
  • top -o %CPU / htop — live CPU and memory per process
  • vmstat 1 5 — CPU, memory, swap and I/O over time
  • free -h — memory and swap
  • iostat -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:

FieldMeaning
MemTotalUsable RAM
MemFreeCompletely unused memory
MemAvailableEstimate of memory available for new applications without swapping
Buffers, CachedRaw disk block buffers; the page cache for file data
Dirty, WritebackData waiting to be written / being written
Shmemtmpfs, shared memory and shared anonymous mappings
Slab, SReclaimableKernel object caches, and the reclaimable part
Committed_AS / CommitLimitMemory promised to processes / the limit under strict overcommit
HugePages_Total / FreeThe 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

SignCommand
Low MemAvailable relative to the workloadfree -h
Swap-in and swap-out activity (not just used swap)vmstat 1 (si, so)
Pressure stalls/proc/pressure/memory
OOM killsdmesg | grep -i "killed process", journalctl -k -g oom
Major page faultssar -B 1, pidstat -r 1

Finding who uses memory

QuestionCommand
Largest processes by resident memoryps -eo pid,rss,comm --sort=-rss | head
Proportional use, including shared pagessmem -rk
Per servicesystemd-cgtop -m, systemctl status <unit> (Memory:)
Kernel memoryslabtop -o | head
tmpfs usagedf -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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
linux memory monitoringlinux available memoryswap pressure linuxlinux oom monitoring
Embedded reference data

Quick lookup tables

Memory operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Memory.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateMemory 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 verificationPin 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 chainprocess/cgroup allocations → page cache/anonymous/slab working set → reclaim + faults → swap or OOM decision → process/service effect → workload acceptanceTrace requested/configured state through effective state to the observed workload result.
Failure boundaryMemory 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 evidenceCorrelated 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 acceptanceUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 boundaryMemory
Topic pathResource Monitoring → Memory
Runtime stateMemory 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 chainprocess/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 boundaryMemory 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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?