Page file

Also known as: pagefile.sys

On this page 7

The page file, stored as the hidden system file pagefile.sys, is the area on disk that Windows uses as backing storage for virtual memory. Within Windows storage & file systems, it is a special file that lets the memory manager move rarely used memory pages out of physical RAM and that raises the system commit limit, the total amount of memory programs may reserve.

The page file is often misunderstood as a slow substitute for missing RAM. In reality, a well-equipped system uses it lightly, yet it still matters: it guarantees memory commitments, supports crash dump creation after a blue screen and gives the memory manager room to keep active data in RAM. Removing it rarely helps and can cause hard-to-diagnose failures.

How the page file supports virtual memory

Every process in Windows works with virtual addresses that the memory manager maps to physical RAM in units called pages, usually 4 KB in size. When RAM fills up, the memory manager removes pages that have not been used recently from a process’s working set. Modified private pages, such as heap data, have no other copy on disk, so they must be written to the page file before their RAM can be reused.

Pages that come from executable files or mapped documents are handled differently: they can be discarded and reread from the original file, so they never need page file space. This is why the page file stores only data that has no other home on disk.

The page file also defines memory accounting. Windows tracks committed memory, which is memory a program has reserved and may use at any time. The commit limit is roughly physical RAM plus the current page file size. When committed memory reaches that limit, allocations fail and applications may crash or report out-of-memory errors, even if Task Manager still shows free RAM.

FigureMeaningWhere to see it
Committed memoryMemory reserved by all processesTask Manager, Memory tab
Commit limitRAM plus page file sizeTask Manager, Committed value
Hard faultsPage reads from diskResource Monitor
Page file usageSpace currently occupied in pagefile.sysPerformance Monitor counters
Memory figures related to the page file

Page file size and configuration

By default, Windows uses a system-managed page file on the system drive. The system chooses an initial size based on installed memory and the configured crash dump type and grows the file automatically when committed memory approaches the limit. The setting lives under System Properties, Advanced, Performance settings and Virtual memory.

OptionBehaviorWhen it fits
System managed sizeWindows sizes and grows the fileRecommended for almost all systems
Custom sizeFixed initial and maximum sizeServers with measured peak commit
No paging fileCommit limit equals RAM onlyRarely justified, risky
Page file on another driveFile placed on a secondary volumeSmall or very busy system drive
Page file configuration options

The old rule of setting the page file to 1.5 times RAM comes from systems with little memory and is not a reliable guide today. A better method is to observe the peak committed memory during the heaviest workload and size the page file so that RAM plus page file comfortably exceeds it, with a margin for growth.

Windows keeps several large hidden files in the root of the system drive, and they are frequently confused. Each serves a distinct purpose and is managed separately.

FilePurposeControlled by
pagefile.sysBacking store for virtual memoryVirtual memory settings
swapfile.sysSwapping of suspended modern appsManaged together with the page file
hiberfil.sysSaved memory image for hibernation and fast startupPower settings, powercfg
MEMORY.DMPCrash dump written after a system failureStartup and Recovery settings
Page file and neighboring system files

The link between the page file and crash dumps matters for troubleshooting. During a blue screen, Windows typically writes the dump into the page file first and copies it to MEMORY.DMP after restart. A page file that is too small or missing can leave no usable dump for analysis, unless a dedicated dump file is configured.

Performance and storage considerations

Heavy paging is slow because even fast storage responds far more slowly than RAM. On an SSD, page file access is much faster than on a hard disk, and modern drives tolerate the writes well; concerns that a page file quickly wears out an SSD are largely outdated for normal desktop use.

Windows also uses memory compression, which compresses inactive pages in RAM before writing them out. This reduces page file traffic and means that a system can hold more data in memory than its physical size suggests. Persistent heavy paging, however, is a clear signal that the workload needs more physical memory, not a larger page file.

Common mistakes with the page file

Most problems arise when users change the defaults to save disk space or to chase performance gains that do not materialize.

MistakeTypical symptomFix
Disabling the page fileOut-of-memory errors with free RAM shownRestore a system-managed page file
Fixed size too smallApplication crashes under loadSize from peak committed memory
Deleting pagefile.sys manuallyAccess denied or file recreatedChange settings, then restart
Placing it on a removable driveBoot warnings or missing page fileUse an internal fixed volume
Expecting a speed boost from removalNo gain, lost crash dumpsAdd RAM if paging is heavy
Page file mistakes, symptoms and fixes

Some organizations require the page file to be cleared at shutdown for security, because it can contain fragments of sensitive data. This policy exists, but it noticeably lengthens shutdown time on systems with large page files, so it should be applied only where the risk justifies it.

A plain-language summary

Think of computer memory as a desk and the page file as a drawer next to the desk. When the desk gets full, Windows moves papers you are not using right now into the drawer. That frees space on the desk for current work.

Getting papers back from the drawer takes a little longer. Still, the drawer prevents a mess when the desk overflows. Most people should let Windows manage the page file on its own.

An example from practice

A 3D artist with 32 GB of RAM disables the page file to save space on a 512 GB SSD, believing it is unnecessary with so much memory. During large renders, the rendering application crashes with out-of-memory errors, although Task Manager shows several gigabytes of RAM still free. The cause is the commit limit: without a page file, it equals physical RAM, and the renderer reserves more memory than it actually touches.

After restoring a system-managed page file, the commit limit rises well above the peak the renderer needs. The renders finish reliably, measured paging activity stays low, and the artist loses only a small amount of disk space in exchange for stable operation and working crash dumps.