Interview Prep/Linux/Storage & Memory

What is the page cache?

AdvancedConceptStorage & Memory
Answer

The page cache keeps recently read and written file data in otherwise unused RAM so repeated reads come from memory. Writes go to the cache first (dirty pages) and are flushed to disk later by writeback threads. "Unused RAM is wasted RAM", so Linux fills it with cache and shrinks it under memory pressure. You can drop clean caches for testing with sync; echo 3 | sudo tee /proc/sys/vm/drop_caches, but never do this as a "fix" in production.

All Linux questions Roadmap: Linux

More on Storage & Memory