The Windows 10 page file, also known as pagefile.sys, is a dedicated system file designed to virtually extend available system memory and support system crash dumps. Unfortunately, it has a reputation of being pretty girthy which can be a problem if disk space is a concern. So, should you leave it alone, modify it, or get rid of it altogether? Let's discuss.
What is a page file?
As mentioned, the page file is a dedicated system file that is enabled by default on Windows desktop and server operating systems. It serves two primary purposes. First, it allows systems to move infrequently accessed modified pages from physical memory to the page file to increase memory efficiency. Second, it's designed to support system crash dumps, allowing the OS to save information that will help you diagnose why your PC blue screened during that intense game of solitaire.
In addition, there are a few application requirements that you should be aware of. Domain controllers, DFS replications servers, certificate servers, and ADAM/LDS servers all require page files. These systems should be left at the default setting of "System Managed".
The page file itself is located on the root of your system drive. If your system resides on C:\, then the path to the page file is C:\pagefile.sys. However, since the page file is a protected system file, you won't be able to see it by default. To see the file, follow these steps.
Open Windows Explorer
Click on your system drive in the navigation pane
Click File > Change folder and search options
Click the View tab
Scroll down and uncheck Hide protected operating system files (Recommended)
You'll receive a warning message that deleting or editing systems files can make your computer inoperable. Click Yes
Click OK to close the Folder Options window
You should now see the pagefile.sys file in the root of your system drive.
While it's great to be able to see these files, as the warning prompt stated, it's best to leave system files hidden so you don't accidentally delete or modify something you shouldn't.
Why is the page file so large?
Now that we know what the page file is and what it does let's discuss why it's so big.
The short answer is, it's complicated.
With so many different contributing factors, it's difficult to precisely calculate page file sizing. In fact, Microsoft even states that page file sizing is unique to each system and can't be generalized.
"Page file sizing depends on the system crash dump setting requirements and the peak usage or expected peak usage of the system commit charge. Both considerations are unique to each system, even for systems that are identical. This means that page file sizing is also unique to each system and cannot be generalized."
As a general rule of thumb, the page file will grow depending on the amount of memory committed to the system and the frequency between system crash dumps.
Should you modify your page file?
While it can be tempting to delete or modify your obnoxiously large page file, the current recommendation is to let Windows continue to manage this setting automatically. If your page file has ballooned in size, there is generally a reason for this behavior. Instead of limiting this behavior, try to understand why it's happening. Monitor your resource usage during your heavy workflows. Does your committed memory approach your committed limit?
Remember, an application doesn't necessarily have to be some complex industrial utility to be a resource hog (looking at you, Chrome). Maybe one day, you felt extra lazy and didn't want to close any of your Chrome tabs or windows. Perhaps an application or web extension has a memory leak causing it to use increasingly more memory over time, and the application was left open running for days on end.
So, when should you modify your page file settings? Well, if you are absolutely strapped for disk space and troubleshooting system dumps isn't a concern for that device, you're probably fine with limiting the size of your page file.
Another option would be to look into expanding your storage drive. Unless you are buying the highest-end SSD or NVME drives, storage prices have come down considerably, so upgrading from a 120GB drive to a 500GB or 1TB SSD isn't as costly as it was years ago.
How to modify page file settings
Okay, once you've committed to putting pagefile.sys on a diet, the actual process of modifying the page file settings is pretty simple. Here's a couple of ways to get it done.
Modify page file settings through advanced system settings
In the Windows 10 search field, enter View advanced system settings
Click on the View advanced system settings control panel item
In the Performance section, click Settings…
Click the Advanced tab
In the Virtual memory section, click Change…
Uncheck Automatically manage paging file size for all drives
Select Custom size:
Set your initial size and your maximum size. This setting will vary depending on the needs of your system. You could set your initial size to 2048MB and your maximum size as 4096MB and see how your system runs. If you run into any errors about running out of memory or sluggish performance, try increasing these values.
Click OK when you are finished
Modify page file settings with PowerShell
If PowerShell is more your style, here's a script that will stop Windows from automatically managing the page file size and set the initial and maximum size you designate.
# Disable Automatically manage paging file size for all drives $computersys = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges; $computersys.AutomaticManagedPagefile = $False; $computersys.Put() | Out-Null # Set Initial size and Maximum size in MB's $pagefile = Get-WmiObject -Query "Select * From Win32_PageFileSetting Where Name like '%pagefile.sys'"; $pagefile.InitialSize = 1024; $pagefile.MaximumSize = 2048; $pagefile.Put() | Out-Nul
If you have PDQ Deploy, you can create a custom package in PDQ Deploy to push this script to as many machines in your environment as needed. If you don't have PDQ Deploy, what are you waiting for? Head over to our free trial download page and test it out for yourself for 14 days.
Here's how to create a custom package in PDQ Deploy to push out this script.
In PDQ Deploy, click New Package
Give the package a descriptive name
Click New Step > PowerShell
Insert the PowerShell script. You can also save the script as a file and point to the file if you prefer.
To deploy your new package, follow these steps.
Click on the package you just created
Click Deploy > Deploy Once
Enter the computer(s) you'd like to deploy the package to and click Add Computer
Click Deploy Now
While having a massive page file can be frustrating, what's more frustrating is running out of resources and dealing with poor system performance. Back when disk space came at a premium, this was more of an issue. With HDD's, SSD's, and NVME drives all coming down in price, this is less of a concern today than it once was. If, however, you still find the need to set your page file settings manually, it may take a few tries before you find the best settings to fit your needs.
Born in the '80s and raised by his NES, Brock quickly fell in love with everything tech. With over 15 years of IT experience, Brock now enjoys the life of luxury as a renowned tech blogger and receiver of many Dundie Awards. In his free time, Brock enjoys adventuring with his wife, kids, and dogs, while dreaming of retirement.