ARCHIVED: What is the purpose of the PAGEFILE.SYS file in Windows NT 4.0?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

Note: For security and support reasons, UITS recommends using Windows 2000 Professional or Windows XP Professional, rather than NT Workstation 4.0, on Indiana University's network. Microsoft retired both mainstream and extended support for this version in June 2004, which means security updates are no longer being developed. For more information, see Microsoft's Windows Desktop Product Lifecycle Guidelines page at:

  http://support.microsoft.com/?LN=en-us&pr=lifecycle

The pagefile.sys file is how Windows NT handles virtual memory using demand paging. Demand paging is essentially a way that the operating system can substitute space on the hard disk for actual RAM. This is accomplished by the Memory Management Unit (MMU) on the CPU. Memory is broken up into small chunks called page frames. In this case, "memory" means the space that exists both in RAM and on the hard disk in pagefile.sys. As code and data load into RAM from the hard disk, RAM fills up. When Windows NT decides that RAM is so full that the operating system needs more RAM to get things done, the operating system takes a look at the page frames in RAM and decides which of these page frames have not been used recently. Once Windows NT has rounded up all the least recently used page frames in RAM, it writes these frames to the hard disk, in the file called pagefile.sys. After these page frames are swapped to disk, Windows NT has then freed up the RAM these frames were taking up. Windows NT then uses this free space to load code and data which previously could not be loaded for lack of RAM space.

Once this paging has taken place, Windows NT continues at the tasks set before it. When this execution of tasks gets to a point where a page frame is needed which had been moved from RAM to the hard disk, Windows NT retrieves the frames swapped out earlier to the hard disk and returns them to RAM. In doing so, Windows NT will probably then need to take some other page frames still resident in RAM and move them to disk in order to make room.

For code to execute or data to be manipulated, the code or data must be in RAM. If an executing process needs to use code or data that have been swapped out to disk, these pieces of code or data get moved back to actual RAM. The sum of total space available in RAM and in pagefiles is often called virtual memory or virtual address space. Demand paging will allow you to run more programs than you actually have the physical RAM to load, but there is a penalty for demand paging in terms of computer speed. Since disk accesses happen at a rate far slower than RAM accesses, each time the operating system is forced to move page frames to and from disk instead of just executing in RAM, performance suffers.

This is document acwa in the Knowledge Base.
Last modified on 2018-01-18 10:29:21.