What is pagefile.sys in Windows, and should it be deleted?
When your Windows computer is running low on storage, you might start looking for ways to free up some space. One of the less conventional methods you may come across is deleting the pagefile.sys file. However, before you consider deleting it, it’s important to understand what pagefile.sys is and whether you should delete it in the first place.
Here’s a quick rundown of what you can adjust about pagefile.sys.
What is pagefile.sys?
pagefile.sys is a system file in Windows that acts as virtual memory for your computer’s RAM (random access memory). When your computer’s RAM starts running low, it uses the pagefile to offload less critical data, such as files and apps, to free up space.
So, how does your computer decide when to unload data from RAM? Let’s take an example with an app to explain how it works.
Normally, when you minimize an app, Windows keeps it running in the background but stores its data in memory so it can quickly reload it when needed.
But when you open a memory-intensive application, Windows needs to make room in RAM. To do this, Windows will offload the data from your minimized apps into the pagefile.sys, freeing up memory without losing any of the data.
Note
By default, Windows stores the pagefile.sys in the root directory of your local drive (C:).
When you need to use a minimized app again, Windows will read its data from the pagefile.sys file. This helps compensate for the lack of physical memory using your local drive.
Reading data from pagefile.sys is slower than accessing it directly from RAM. If you’re using a hard disk drive (HDD) instead of a solid-state drive (SSD), this process will be even slower. However, it’s still faster than completely closing and reopening the app.
How to Check the Size of pagefile.sys?
By default, Windows hides the pagefile.sys file to prevent tampering. If you’d like to see it, follow these steps:
- Press Win + E to open File Explorer.
- Click on This PC in the left pane, then double-click on the Local Disk (C:) in the right pane to open it.
- Now, you need to open Folder Options. In Windows 11, click the three dots in the top menu and select Options.
- In Windows 10, click View in the top menu, then select Options. In the Folder Options window, go to the View tab and uncheck Hide protected operating system files (Recommended).
- In the warning prompt that appears, click Yes.
- Select the Show hidden files, folders, and drives option.
- Click OK to close Folder Options and apply the changes.
- Scroll down in the Local Disk, and you’ll now be able to see pagefile.sys.
As you can see, the pagefile.sys file is quite large, which is why some people consider deleting it when storage space is tight.
Should You Delete pagefile.sys?
Deleting pagefile.sys to free up disk space might make sense if you have a lot of RAM. With sufficient memory, your system can store all the data needed to keep applications running without unloading anything. For most Windows users, a minimum of 16GB of RAM is recommended.
However, if you delete pagefile.sys and your computer runs out of physical memory, your system will start to slow down. If the slowdown gets too bad, Windows itself might even crash.
You might also notice some applications running slower or crashing. This happens because they have nowhere to store the data they need to operate normally, since your RAM is full and there’s no pagefile.sys to handle the overflow.
So, unless your physical memory requirements don’t exceed the installed RAM, we recommend keeping pagefile.sys enabled.
How to Delete pagefile.sys
Since Windows constantly uses pagefile.sys, you can’t simply delete it through File Explorer. However, there’s another way to remove the file and free up some disk space. Just follow these steps:
- Press Win + S to open Windows Search.
- Type sysdm.cpl into the search bar and hit Enter.
- Select the Advanced tab, then click the Settings button under the Performance section.
- In the Performance Options dialog, go to the Advanced tab and click Change.
- In the Virtual Memory dialog, uncheck the box at the top that says Automatically manage paging file size for all drives.
- Select the No paging file radio button, then click Set.
- You’ll get a warning from Windows. Click Yes to confirm.
- Click OK to close the Virtual Memory dialog and apply the changes.
- Restart your computer for the changes to take effect.
Once Windows reboots, it will no longer use pagefile.sys, and the file will be removed from your local drive.
How to Adjust the Size of pagefile.sys
If deleting pagefile.sys isn’t an option for you, you can adjust its size instead. Here’s how to do it:
- Press Win + S to open Windows Search.
- Type sysdm.cpl in the search bar and press Enter.
- Click on the Advanced tab, then click the Settings button under the Performance section.
- In the Performance Options dialog, go to the Advanced tab and click Change.
- In the Virtual Memory dialog, uncheck the box that says Automatically manage paging file size for all drives.
- Select the Custom size radio button. You’ll now see two text boxes (Initial size and Maximum size) become active.
- Enter the desired page file size in both text boxes (in megabytes), then click Set.
- Click OK to close the Virtual Memory dialog and apply the changes.
- Restart your computer for the changes to take effect.
That’s it! Your pagefile size will now be adjusted.
Is pagefile.sys Important?
pagefile.sys is crucial for keeping your Windows computer running smoothly. It helps provide extra memory space for your PC when physical RAM can no longer handle more data.
You can delete it, but only if you’re sure your computer has enough memory to run on its own. If not, it’s better to simply adjust the size of pagefile.sys so it doesn’t take up too much space. If you’re not sure what to do, it’s best to let Windows manage the file automatically and look for other ways to free up space on your storage drive.