You would have come across page cache and buffer cache, whether or not you were aware of it- if at any time you checked the memory usage on a Linux server and saw a large amount of RAM listed as “cached” or “buff/cache”.
They are more than simple consumers of memory; in fact, they are active mechanisms for performance optimization which have been incorporated into the Linux kernel. Their purpose is to reduce disk I/O, improve application response times, and make good use of available memory. Yet the distinction between page cache and buffer cache often causes confusion even among experienced Linux administrators and system engineers.
If you understand how these caching mechanisms work, you will be able to troubleshoot performance problems, correctly interpret memory usage, and avoid common misconceptions such as the idea that “Linux is using too much RAM.”
What Is Page Cache?
The page cache is a mechanism used by the Linux kernel to speed up file access by keeping frequently accessed data in memory. Upon reading a file from disk, Linux stores a copy of that data in RAM, and when the file is requested again, the kernel supplies it directly from memory rather than retrieving it from disk.
Because RAM can be accessed much more quickly than storage, the page cache greatly reduces I/O latency and improves overall system performance.
Example
A web server that continuously provides the same static files (for example, HTML, CSS, JavaScript, or images) gains significant benefits from page caching; once these files are stored in memory, subsequent requests are served almost immediately without requiring any further access to disk.
Key Characteristics
- Stores file contents (actual data)
- Works with regular files such as documents, binaries, images, and media
- Automatically managed by the Linux kernel
- Frees cached pages automatically when applications require more memory
What Is Buffer Cache?
The buffer cache deals with raw block-level data and filesystem metadata rather than the actual contents of files; it temporarily holds the information the filesystem needs to carry out disk operations efficiently. Common examples include:
- Inodes
- Directory entries
- Superblocks
- Block device metadata
In the past, the buffer cache was of great importance since Linux filesystems had a more direct interaction with block devices; although much of its functionality has now been incorporated into the page cache in modern Linux kernels, it is still useful to understand the conceptual difference.
Simply put:
Page Cache vs Buffer Cache: Key Differences
Page Cache
- Stores the actual contents of files.
- Speeds up file reads and writes by serving data directly from memory.
- Appears as “Cached” in Linux memory monitoring tools.
- Primarily used for application file access.
- Remains a core and highly active component of modern Linux memory management.
Buffer Cache
- Stores filesystem metadata and block-level data.
- Optimizes filesystem operations and block device access.
- Appears as “Buffers” in Linux memory monitoring tools.
- Primarily supports filesystem management and low-level I/O operations.
- In modern Linux kernels, much of the functionality is integrated into the page cache, making it less distinct than in older versions.
The page cache keeps file data. The buffer cache contains metadata related to the file system and block-level information.
How the Linux Kernel Uses Page Cache and Buffer Cache
- During File Reads
When an application reads a file:
The kernel verifies whether the requested data is already in the page cache.
When the data is available, it is supplied directly from memory (the fast path).
If that is the case, Linux will read the data from disk and cache it for future requests. This process reduces the need for repeated disk accesses and enhances application performance.
- During File Writes
When data is written to a file:
The data is first stored in the page cache rather than being written to disk immediately.
This is referred to as write-back caching.
The background kernel processes then write the modified data to persistent storage. With this method, applications can continue executing without waiting for slower disk operations.
- Where Buffer Cache Fits In
Buffer cache continues to support low-level filesystem operations by:
- Managing filesystem metadata
- Coordinating block device access
- Handling low-level I/O operations
- Assisting with filesystem consistency
The responsibilities that are now closely integrated with the page cache still play an important supportive role in the Linux kernel through the buffer cache.
How to Observe Cache Usage in Linux
There are various tools available in Linux for viewing cache utilization.
Using free -h
The memory used by the page cache and the buffer cache is what the buff/cache column shows.
Using /proc/meminfo
Key entries include:
- Cached → Memory used by page cache
- Buffers → Memory used by buffer cache
- Using vmstat
The vmstat command gives further insight into memory usage, caching behaviour, and disk I/O activity. Cached memory is not merely unused memory, and Linux will automatically reclaim it whenever applications need more RAM.
Common Misconceptions About Linux Cache
1. Cache is using all of my RAM
Not true.
Linux deliberately uses available RAM for caching, since memory that is not in use offers no performance improvement, and cached memory can be freed at once when applications need it.
2. Clearing the cache results in an improvement of performance
In most cases, it actually lowers performance.
Commands such as:
echo 3 > /proc/sys/vm/drop_caches
Force Linux to clear its cache so that all subsequent requests must be read from disk again. This increases disk I/O, thereby slowing applications.
3. The page cache and the buffer cache are identical
They are related yet not the same. File data is stored in the page cache, and the buffer cache manages metadata and block-level filesystem information. Although modern Linux kernels have combined these functions, it is still useful to understand the conceptual differences for troubleshooting purposes.
Practical Performance Insights
- Diagnosing Slow Disk Performance
When an application seems to be running slowly but disk I/O is still low, it is likely that the page cache is already meeting the demand of most of the requests efficiently. Conversely, systems with a cold cache usually experience brief periods of slower performance immediately after reboot.
- Database Workloads
Many database systems have their own caching mechanisms, which can, in some cases, lead to double caching—that is, both the database and the Linux kernel store the same data in memory.
- Memory Pressure
When available RAM becomes limited, the kernel tends to evict pages that have been less frequently used and are currently cached. Active applications are given higher priority. Memory is adjusted dynamically when required.
- File-Heavy Applications
Because repeated access to files avoids expensive disk operations, applications that frequently read static files, such as web servers, file servers, and content delivery systems, benefit greatly from a page cache.
At what time should you take cache into account?
Understanding how Linux employs caching enables administrators to interpret system metrics correctly and make well-informed performance decisions. Most Linux systems automatically manage their cache without requiring the administrator to intervene. However, understanding cache behavior becomes valuable when:
- Investigating memory usage anomalies
- Troubleshooting disk I/O bottlenecks
- Optimizing Linux server performance
- Managing memory-intensive workloads
- Monitoring production server performance
Final Thoughts
Page cache and buffer cache are essential elements of Linux memory management; although the page cache holds the contents of files and the buffer cache manages filesystem metadata, modern Linux kernels have combined these two mechanisms into an efficient caching strategy that ensures optimal performance.
The most important takeaway is this: Linux does not waste memory; instead, it uses available RAM intelligently to enhance system performance. When applications need more resources, the cached memory is automatically reclaimed, making Linux one of the most efficient operating systems for managing both memory and storage performance.

