On some Microsoft™ Windows™ operating systems, a pagefile is the name given to a portion of the hard disk reserved to augment Random Access Memory (RAM). It acts as virtual RAM, or virtual memory, to improve access time for frequently used programs and data. All else being equal, the less RAM a system has, the larger the reserved portion is likely to be. If enough RAM is present, there may be no pagefile.
RAM is a quick-storage area designed to improve access time to frequently used programs, processes, and files. Retrieving data from RAM is faster than retrieving it from standard platter-style hard disks. As a computer system boots, it stores many routines into RAM so that the system can perform better. As the user opens programs, even more RAM is consumed. Firewalls, antivirus programs and other software that runs in the background also consumes RAM.
When RAM becomes full, the system turns to the hard drive for help. Using contiguous, empty space, the system designates a pagefile of a certain size. The portion must consist of contiguous space, and not just any empty space. The system can access information in contiguous space faster than if it’s spread out over drive platters.
The least accessed data located in RAM is automatically moved to the pagefile. As the user switches to other programs or files, this seamless process continues, using the area as a holding cell. Going back to a previous program will cause the system to swap contents in the pagefile for contents in RAM. In earlier Windows versions, it was known as a swapfile.
If the user has so many processes and programs running that they cannot all be run from RAM, the overflow is run from the pagefile itself. While faster than running it from random locations on the drive, this is noticeably slower than RAM access. Ideally, a system has so much RAM that a pagefile isn’t required, though some programs designed to work with one will create it.
When a computer shuts down, all data in RAM is lost. This is not true of the hard disk of course, which maintains information. Pagefile contents, while deleted at shutdown, can be retrieved later using software recovery tools. For this reason, some people configure their computers to wipe the area clean when they turn off the computer. Wiping does slow the shutdown process considerably, but is a good security measure for anyone concerned. In either case, a new pagefile is created as needed at the next boot.