The size of your page file is determined by several contributing factors, including the total physical memory available, peak usage, crash dump requirements, and more. If you’ve got questions about your page file, we’ve got answers. So what is it? Why is it so big (queue the Michael Scott reference)? And can you delete it? Let's find out.
What is a page file?
The pagefile.sys file, also known as a page or paging file, is a default system file found on Windows operating systems, including Windows 10, Windows 11, and Windows Server. A page file is a way for Windows to virtually extend the available memory on a system.
What does a page file do?
Page files perform several different functions. First, they allow systems to move infrequently accessed modified pages from physical memory to the page file, increasing memory efficiency. Second, they're designed to support system crash dumps, allowing the OS to save information that helps you diagnose why your PC blue screened. Lastly, several applications require page files. For example, domain controllers, DFS replication servers, certificate servers, and ADAM/LDS servers all require page files.
Why is my pagefile.sys so big?
While some page files are relatively small, others can occupy a significant portion of your disk drive. My current page file is sitting at a whopping 15 GBs. So why are some page files so substantial? The 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, the page file grows depending on the amount of memory committed to the system and the frequency between system crash dumps. It can also mirror how much physical RAM your device has installed. If you have 32 GB of RAM, you could have a 32 GB page file.
Centralize your Windows device management
Gain real-time visibility, deploy software, remediate vulnerabilities, schedule reports, automate maintenance tasks, and access remote devices from one easy-to-use platform.
Where is pagefile.sys located in Windows 10?
By default, page files are located on the root of your system drive. For most people, this is the C: drive. However, pagefile.sys is a hidden and protected system file, so you'll need to modify your File Explorer folder options to view your page file.
Here's how to display hidden files and protected operating systems files in File Explorer on Windows 10.
Right-click on the Windows Start button, then click File Explorer.
Click This PC in the left navigation bar, then double-click Local Disk (C:). If your system drive is assigned to something other than C, click on the drive letter assigned to your system drive.
Click File > Change folder and search options.
Click the View tab.
Select Show hidden files, folders, and drives, and uncheck Hide protected operating system files (Recommended). Click Yes when prompted by a warning about displaying protected system files.
Click OK to save and close the options window.
You should now see your pagefile.sys file in File Explorer. You can right-click on the page file and click Properties to view information about the file, including its file size.
Ready to migrate to Windows 11?
Here's our guide on how to create a Windows deployment plan.
Where is the pagefile.sys located in Windows 11?
The page file in Windows 11 is located on the root of your system drive, which for most people is their C: drive. As with Windows 10, you'll need to modify some File Explorer settings in Windows 11 to view the file, though the process has changed slightly in Windows 11.
Here's how to find your page file in Windows 11.
Right-click on the Start button, then click File Explorer.
Click This PC, then double-click your Local Disk (C:) drive (or whatever your system drive letter is).
In the top toolbar, click the ellipsis button, then click Options.
Click the View tab.
Select Show hidden files, folders, and drives, and uncheck Hide protected operating system files (Recommended). Click Yes when prompted by a warning about displaying protected system files.
Click OK to save and close the options window.
The page file at the root of your system drive should now be visible. Just be careful not to accidentally delete any critical system files while you have them visible. Definitely not speaking from experience.
Should you modify your page file size?
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?
It's important to remember that any application can be a resource hog. Even something as simple as opening way too many Chrome tabs can quickly drain your available system resources.
So when should you modify your page file settings? First, consider your other options. Clean up your files, transferring what you can to storage drives. Maybe delete your collection of Matlock episodes you downloaded from that P2P network. Also, consider upgrading your hard disk or SSD and converting those GBs to TBs. If you've exhausted your available options and are still set on shrinking your page file, go for it. Most users shouldn't run into an issue by just limiting their page file to a manageable size.
Ready to put that smaller page file to work?
Deploy it across your remote or on-prem environment in minutes.
Modifying page file settings using advanced system 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 how to modify your page file settings using advanced system settings in Windows 10 and Windows 11.
In the Windows search field, enter view advanced system settings, then 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 varies depending on the needs of your system. Potentially set your initial size to 2048 MB and your maximum size to 4096 MB and see how your system runs. Try increasing these values if you encounter any errors about running out of memory or sluggish performance.
Click OK when you are finished.
You'll receive a warning message informing you that changes won't take effect until you restart your computer.
After restarting your computer, your page file should reflect the settings you configured.
Modifying 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. Remember to modify the $pagefile.InitialSize and $pagefile.MaximumSize to your specifications.
# 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-Null
This PowerShell script can quickly modify your page file settings, which is especially helpful if you need to modify settings on multiple computers.
Looking for other PowerShell pro tips?
Here are three of our favorite PowerShell modules.
Deploying the page file script to multiple devices using PDQ Deploy
If you have PDQ Deploy, you can create a custom package in PDQ Deploy to push the page file PowerShell 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 and test it out for yourself for 14 days.
Here's how to create a custom PowerShell package in PDQ Deploy to distribute the page file 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.
Click Save to save and close the package.
To deploy your new package, follow these steps.
Click on your page file PowerShell package.
Click Deploy > Deploy Once.
Enter the computer(s) you'd like to deploy the package to, then click Add Computer.
Click Deploy Now.
Within minutes, you can deploy this script to hundreds of devices. Just make sure you thoroughly test your script before a mass deployment.
Deploying a PowerShell script using PDQ Connect
If most of your devices are remote, then you can use an agent-based solution, like PDQ Connect, to deploy your PowerShell scripts. If you haven't tried PDQ Connect yet, head over to our Connect sign-up page and try it out free for 14 days. Tell them Brock sent you. You won't get anything extra, but it's the thought that counts.
Here's how to deploy the page file PowerShell script using PDQ Connect.
In PDQ Connect, click Packages, then click Create package.
Name the package, click the Add install step drop-down menu, then click Add script step.
Import the PowerShell file, or paste the PowerShell script into the scripting field, then click Save.
Locate and select the package you just created, and then click Deploy.
Enter the name of the devices or groups you want to deploy the package to, then click Deploy.
Since PDQ Connect is an agent-based solution, you'll be able to deploy this script to all your devices, no matter where they're located. The only requirement is a stable internet connection.
Find a page file size that works for you
Excessively large page files can be frustrating, but running out of system resources and dealing with poor system performance can be even more irritating. While there's no one-size-fits-all solution for everyone, testing different page file settings can ensure you find what works best for your situation. If all else fails, large HDDs, SSDs, and even NVME drives are cheaper than ever. It might be time to consider expanding your storage.