What is the OS page cache (buffer cache), and how does it improve file I/O performance?
Last updated
The page cache (buffer cache) is RAM holding recently accessed file/disk data, so cache hits avoid disk I/O. Read-ahead prefetches sequential blocks.
Write-back keeps dirty pages in RAM and flushes later, batching writes. Data can be lost on crash, so
fsync()forces durability.It uses LRU-like eviction and grows into free RAM, shrinking when applications need memory.