Why is my page file so huge?

Brock Bingham candid headshot
Brock Bingham|May 31, 2023
Illustration of computer desk and monitor with PDQ logo
Illustration of computer desk and monitor with PDQ logo

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.

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.

  1. Right-click on the Windows Start button, then click File Explorer.

    Launch File Explorer.

  2. 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.

    Go to the root of your system drive.

  3. Click File > Change folder and search options.

    Open File Explorer's search options.

  4. Click the View tab.

  5. 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.

    Select show hidden files, folders, and drives. Unselect hide protected operating system files (recommended).

  6. 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.

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.

  1. Right-click on the Start button, then click File Explorer.

    Launch File Explorer.

  2. Click This PC, then double-click your Local Disk (C:) drive (or whatever your system drive letter is).

    Open your system drive. This will usually be your C: drive.

  3. In the top toolbar, click the ellipsis button, then click Options.

    Open Files Explorer's Options menu.

  4. Click the View tab.

  5. 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.

    Select Show hidden files, folders, and drives. Unselect Hide protected operating system files (Recommended).

  6. 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?

Committed memory versus the 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.

  1. In the Windows search field, enter view advanced system settings, then click on the View advanced system settings control panel item.

    Open the advanced system settings menu.

  2. In the Performance section, click Settings.

    Open the performance settings menu.

  3. Click the Advanced tab.

  4. In the Virtual memory section, click Change.

    Open the virtual memory settings menu.

  5. Uncheck Automatically manage paging file size for all drives.

  6. Select Custom size:

  7. 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.

  8. Click OK when you are finished.

    Uncheck automatically manage paging file size and configure a custom file size.

  9. 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.

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.

  1. In PDQ Deploy, click New Package.

  2. Give the package a descriptive name.

  3. Click New Step > PowerShell.

    Add a new PowerShell step to the package.

  4. Insert the PowerShell script. You can also save the script as a file and point to the file if you prefer.

  5. Click Save to save and close the package.

    Add the PowerShell script, then save and close the package.

To deploy your new package, follow these steps.

  1. Click on your page file PowerShell package.

  2. Click Deploy > Deploy Once.

    Select the package, then click Deploy, then click Deploy Once.

  3. Enter the computer(s) you'd like to deploy the package to, then click Add Computer.

  4. Click Deploy Now.

    Add targets, then 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.

  1. In PDQ Connect, click Packages, then click Create package.

    Click Packages, then click Create Package.

  2. Name the package, click the Add install step drop-down menu, then click Add PowerShell step.

    Name the package, and add a PowerShell step.

  3. Import the PowerShell file, or paste the PowerShell script into the scripting field, then click Save.

    Add the PowerShell script to the package, then click Save.

  4. Locate and select the package you just created, and then click Deploy.

    Select the page file package, then click Deploy.

  5. Enter the name of the devices or groups you want to deploy the package to, then click Deploy.

    Add the target devices, 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.

Brock Bingham candid headshot
Brock Bingham

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.

Related articles