What’s a page cache?

Print anything with Printful



A page cache is a portion of a computer’s RAM used to hold and modify data from a hard drive for faster access. It is automatically controlled by the operating system and can increase the life of a hard drive.

A page cache, also called a disk cache, is an area of ​​a computer’s random access memory (RAM) used to hold and possibly modify data stored on a hard drive or other permanent storage device. An operating system uses a page cache for speed and efficiency, because it is faster to read and write information to RAM than to continuously access areas of a hard drive. In most cases, the mechanism used for caching areas of a hard drive is automatically controlled by the operating system and should not be managed or otherwise managed by users or applications. Depending on the operating system, page caching is sometimes used for all read and write operations from a hard drive, regardless of the amount of information read or written. Another OS-specific attribute of page caching is that, after a certain amount of time, the cache is automatically flushed of all unused information to maintain a large pool of free memory for other applications.

When a computer program requests information from a traditional hard drive, a relatively time-consuming process can take place to retrieve the information. The hard drive is random access media, so it has to physically move a drive to a location on the disk that matches where the data block is located. After this occurs, the information is read into the computer, where it can be processed. To read consecutive blocks of information from the drive, multiple movements of the physical drive, or head, must be performed. This process can take even longer when writing large files to disk.

Computer RAM, on the other hand, does not require a physical reader and is located very close to the computer’s central processing unit (CPU). Reading and writing to RAM is much faster than reading and writing to a hard drive. A page cache is a way to minimize the amount of physical reading and writing that needs to be done to a hard drive.

The process is done by reading a certain amount of information from the hard drive when required. The amount of data stored in a page cache in RAM is determined by the size of the cache and not necessarily by the amount of information requested. Once the data from the drive is in RAM, it stays in RAM until it is no longer needed or until a point where any changes to the data in the cache must be written or erased to the hard drive to be permanently saved. Flushing the cache can happen when memory needs to be freed, after a certain amount of time, or even by executing a user command if needed.

In most cases, a page cache is used to store files that don’t change but need to be referenced continuously, such as executable files and libraries for applications. To increase the speed and safety of running applications from a page cache, some systems mark the memory used for executables as read-only. Using a cache can actually increase the life of a hard drive by reducing the possibility of thrashing the drive from multiple reads and writes in a short period of time.




Protect your devices with Threat Protection by NordVPN


Skip to content