Skip to content
Calcrivo

Page Cache Calculator

Calculate the portion of RAM used as page cache and its effect on available memory.

Inputs

Used to estimate cache hit ratio

Total Page Cache (MB)

6,300

Page Cache as % of RAM

38.45%

Estimated Cache Hit Ratio

100.0%

Note

Page cache (Cached + Buffers) is reclaimable — it counts toward MemAvailable, not toward memory pressure.

Step by step

  1. Values used

    MemTotal (MB) = 16,384; Cached (MB, from /proc/meminfo) = 6,000; Buffers (MB, from /proc/meminfo) = 300; Application Working Set (GB) = 5

  2. Page cache total

    page_cache = Cached + Buffers

  3. Total Page Cache (MB)

    = 6,300

  4. Page Cache as % of RAM

    = 38.45

  5. Estimated Cache Hit Ratio

    = 100.0

  6. Note

    = Page cache (Cached + Buffers) is reclaimable — it counts toward MemAvailable, not toward memory pressure.

How it works

Page cache (the Cached field in /proc/meminfo, plus Buffers for block-device metadata) holds recently accessed file data in RAM so repeat reads avoid disk I/O entirely. It grows to fill whatever RAM isn't claimed by applications and shrinks automatically (least-recently-used pages evicted first) when applications need more memory — this is why a healthy Linux system typically shows most of its RAM as 'used' by cache, which is a feature, not a leak.

Formula

Page cache total

page_cache = Cached + Buffers

C
Cached (file page cache)
B
Buffers (block device buffers)

Frequently Asked Questions

What's the difference between page cache and a database's own cache?

Page cache operates at the OS/filesystem level and caches raw file blocks regardless of what reads them; a database's internal cache (e.g. PostgreSQL's shared_buffers or MySQL's InnoDB buffer pool) caches parsed, structured pages at the application level with knowledge of query patterns. Many systems benefit from both layers working together, though tuning them to avoid excessive double-caching is a common performance exercise.

Does page cache persist across reboots?

No — page cache lives entirely in volatile RAM and is lost on reboot or power loss, since it's just a performance optimization over data that already exists safely on disk, not a data store in its own right.

How can I check what's using page cache?

`free -h` shows the aggregate cache size, while tools like vmtouch or fincore can show which specific files currently have pages resident in cache, useful for verifying that a hot dataset is actually cache-resident as expected.

You might also need