Reading /proc/meminfo

/proc/meminfo is the authoritative source for memory statistics on Linux. Tools like free, top, and monitoring agents all read from it. Once you understand what each line means, you'll never misread "free" memory again.

Sample /proc/meminfo Output

$ cat /proc/meminfo MemTotal: 32768000 kB ← Total physical RAM MemFree: 1234568 kB ← Completely unused RAM MemAvailable: 18432000 kB ← RAM available for new processes (*) Buffers: 512000 kB ← Disk metadata cache Cached: 14000000 kB ← File data page cache SwapCached: 123000 kB ← Swap pages re-read into RAM Active: 10000000 kB ← Recently used pages Inactive: 6000000 kB ← Less recently used, reclaimable SwapTotal: 8388608 kB ← Total swap space SwapFree: 7864320 kB ← Unused swap Dirty: 123456 kB ← Pages modified, not yet written to disk Writeback: 1234 kB ← Pages being written to disk right now Slab: 987654 kB ← Kernel slab allocator total SReclaimable: 654321 kB ← Slab pages that can be reclaimed SUnreclaim: 333333 kB ← Slab pages that cannot be freed PageTables: 45678 kB ← Memory used by page tables themselves HugePages_Total: 0 ← Explicit huge pages reserved HugePages_Free: 0 Hugepagesize: 2048 kB

The Most Important Fields

MemAvailable — Use This, Not MemFree

MemFree shows truly unoccupied RAM — usually low because Linux fills RAM with cache. MemAvailable estimates how much RAM is actually available for new applications, accounting for reclaimable cache. This is what monitoring tools should alert on.

Cached vs Buffers

Cached = file data cache (the page cache — cached file contents). Buffers = metadata cache (directory entries, superblocks). Both are reclaimable when memory pressure increases. In modern kernels these are largely unified in the page cache.

Dirty — Pages Not Yet Written

Dirty pages are in-memory modifications not yet written to disk. Linux writes them asynchronously. High Dirty value means writes are piling up. If the system crashes before they're written, data is lost. fsync() forces a flush.

Slab — Kernel Object Cache

The slab allocator caches kernel data structures (inodes, dentries, task structs). SReclaimable can be freed under pressure; SUnreclaim cannot. High slab usage with many tiny files is common on busy webservers.

free -h — Human-Readable View

$ free -h total used free shared buff/cache available Mem: 32G 12G 1G 500M 19G 19G Swap: 8G 512M 7G # "used" = MemTotal - MemFree - Buffers - Cached # "available" = MemAvailable from /proc/meminfo # "buff/cache" = Buffers + Cached # CORRECT interpretation: # Real free for new processes = "available" column = 19G # NOT "free" column (1G) — that excludes reclaimable cache

Frequently Asked Questions

What will I learn here?

This page covers the core concepts and techniques you need to understand the topic and progress confidently to the next lesson.

How should I use this page?

Start with the overview, then follow the section links to deepen your understanding. Use the table of contents on the right to jump to specific sections.

What should I read next?

Use the navigation below to continue to the next lesson or explore related topics.