You have 32 GB of RAM, so a guide told you the page file is a leftover from smaller machines and can go. Or a game crashed with an out-of-memory error while Task Manager showed plenty of free RAM. Or, in the middle of a match, Windows said "Your computer is low on memory" and asked you to close programs.
All three come from the same mechanism, and it is not the one the "turn it off" advice assumes.
What the page file is for
Windows hands out memory in two steps. A program first commits memory, which is Windows promising that the space exists, and only later writes to it. Microsoft's introduction to the page file defines the ceiling on those promises: the system commit limit is the sum of physical memory and all page files combined.
The total of all promises is the commit charge, and it is not the same as RAM in use. Microsoft's performance guide on committed memory points out that committed memory has not necessarily been written to or touched, so the charge can reach the limit while plenty of physical memory is still available. That is how a game can run out of memory while Task Manager shows free RAM.
The page file has a second job: holding memory that has been changed but is rarely used, so Windows can take it out of RAM and give that RAM to something busier. Its third job, crash dumps, has its own section below.
What happens without one
With no page file, Microsoft's page file sizing guide says the commit limit becomes slightly less than the physical memory installed. Every program's promises now have to fit inside RAM, including memory that has been promised and not yet used.
When the charge reaches the limit, the introduction says the system and processes might not get committed memory, which can cause freezing, crashing and other malfunctions. Mark Russinovich, writing about Windows virtual memory in 2008, put it plainly: when the commit limit is reached, allocations that commit memory fail. A game asking for memory at that moment does not get it.
He also answered the speed argument. Some feel that having no paging file results in better performance, he wrote, and some workloads may; but in general a paging file lets Windows write out pages that are not being actively used, which leaves more usable memory for the system. Microsoft's introduction adds that some products and services require a page file.
Crash dumps need it too
When Windows crashes with a Stop error, the record of what failed is, by default, written through the page file. Microsoft's dump documentation says the contents of RAM are written to the paging file on the partition where Windows is installed, that the paging file must be on the boot volume for the dump feature to work, and that if it has been moved to another volume it must be moved back. With the default dump type, Automatic memory dump, and a page file on System managed size, Windows sizes the page file so that a kernel memory dump can be captured most of the time.
The Virtual Memory dialog warns about this itself: if you disable the paging file or set its initial size below a certain number of megabytes and a system error occurs, Windows might not record details that could help identify the problem. Without those details, finding out why a game crashed gets harder.
Check how close you are to the ceiling
Open Task Manager, go to Performance and select Memory. Committed shows two numbers: the commit charge, then the commit limit. If the first gets close to the second while you play, you are near the ceiling this page is about, whatever In use (Compressed) says.
Two Microsoft guides give slightly different thresholds for that ratio. The performance guide linked above calls anything over 75% close to running out; Microsoft's current performance troubleshooting guide lists 0 to 50% as healthy, 60 to 80% as a warning and 80 to 100% as critical.
To see which program holds the promises, the Details tab has a Commit size column for each process; Select columns adds it if it is hidden. If Windows has already run low, it logs event 2004 from Microsoft-Windows-Resource-Exhaustion-Detector in the System log, with a message that names the programs that consumed the most virtual memory. This PowerShell command lists the last five:
Get-WinEvent -FilterHashtable @{LogName='System'; ProviderName='Microsoft-Windows-Resource-Exhaustion-Detector'; Id=2004} -MaxEvents 5 | Format-List TimeCreated, Message
If it reports that no events were found, the log holds no such event.
How big it should be
Leave it on System managed size. The sizing guide says page files are system-managed by default, and that the right size depends on your crash dump setting and your peak commit charge, is unique to each system and can't be generalized. Russinovich called the old RAM-multiplier formulas useless for the same reason.
A system-managed page file grows on its own. When the commit charge passes 90 percent of the limit, it grows up to three times your RAM or 4 GB, whichever is larger, but no more than an eighth of the volume, and only if the disk has the free space. Keep some room free on the drive that holds it.
There is one documented exception. In KB 4055223, listed for Windows 10 and Windows 11, Microsoft describes random out-of-memory errors in programs that allocate memory often, which can come from the delay while an automatic page file grows. Its workaround is a custom size with an initial size of 1.5 times your RAM, raised further if the errors continue. That conflicts with the "can't be generalized" line above and with Russinovich, so treat it as the fix for that one symptom, not a rule.
To change the setting, press Win+R and run SystemPropertiesAdvanced. Under Performance, choose Settings..., open the Advanced tab and choose Change... under Virtual memory. The top checkbox is Automatically manage paging file size for all drives. Below it, per drive, are Custom size, System managed size and No paging file. Set applies the choice to that drive; then select OK and restart the PC.
SSD wear
The other reason given for removing it is SSD wear. Microsoft's Windows 7 engineering blog reported page file reads outnumbering writes by about 40 to 1 in its 2009 telemetry, and concluded there are few files better than the page file to place on an SSD. Those are 2009 figures, so take them as the pattern, not today's numbers.
For scale on a newer drive, Samsung's 2022 990 PRO datasheet rates the 1 TB model for 600 TB written under a five-year limited warranty, whichever comes first. Spread evenly, that is about 330 GB of writes a day for five years; that division is ours, not Samsung's.
What does not help
- Turning it off because you have plenty of RAM. The limit then sits just under your RAM, and every promise has to fit inside it, used or not.
- A small fixed size. The limit is RAM plus the page file, so a page file smaller than your peak needs lowers the ceiling the same way, only less.
- Moving it off the Windows drive. Crash dumps need a paging file on the boot volume, as above.
- Memory optimizer tools. Microsoft's performance guide says so-called memory optimizers force the kernel to delete its disk cache and trim the working sets of processes, which causes a lot of unnecessary disk I/O.
Related
- Why did my game crash?
- Task Manager for gamers
- Running out of VRAM
- Why games stutter on Windows 11
- SSD vs HDD for games
Did this page help?
What was missing, or what did not work? We read every one of these.
If this page did not solve it, write to us — say which article you read, and we will fix the article.