How to Delete Pagefile.sys in Windows 11

Published by Nyau Wai Hoe - Updated on

Pagefile.sys is a hidden system file that can appear in the root of your drive. The size of the pagefile.sys file depends on how much disk space is assigned as the paging file size for the drive. The disk space it takes up can sometimes be so large that it may make you want to delete it, especially when you are running out of storage space.

Before you consider deleting it, you need to know what it does, if you should delete it, and how to correctly delete the file. This guide will explain what pagefile.sys is used for and how to delete the file or reduce its size in Windows 11.

Also see: How to Delete Windows Update Files in Windows 11

What is pagefile.sys used for in Windows

What is pagefile.sys used for in Windows?

Pagefile.sys is a hidden system file that is used as virtual memory in Windows. When your computer is running out of RAM at any moment because some apps are using too much RAM, Windows will attempt to move some of the least used pages of memory to the pagefile.sys, in order to free up some RAM for the applications you are actually using.

For example, if your RAM usage is at about 80% or more, Windows may start utilizing the page file and move the memory of some of the least active applications (such as those you’ve minimized) to the pagefile.sys. By doing so, more RAM can be freed and be ready for those apps that you are actually actively using.

Since the speed of a disk drive (even SSD) is always much more slower than that of the RAM, those apps whose memory were pushed to the page file may take some time to restore when you need to use them again.

In other words, if you have sufficient RAM, Windows may not use the virtual memory (page file). However, you need to have at least a few gigabytes of page file for Windows 11 to work stably.

Suggested read: How to Clean C: Drive in Windows 11

What happens if you disable page file in Windows 11?

If your PC has no page file at all (if you select “no paging file” for all drives), applications may crash anytime when you are about to reach your RAM limit. In addition, some applications may not work properly or simply won’t run if it requires pagefile to work.

Therefore, you should at least set a few gigabytes as the paging file size for one of your drives, or select “System managed size” for a drive to allow Windows to automatically manage the page file on the selected drive.

Why can’t I see the pagefile.sys in File Explorer?

The pagefile.sys file is a highly sensitive operating system file that is hidden by default unless you enable the corresponding option to unhide such files. The setting to unhide these protected OS files can be found via File Explorer > Folder Options > View.

Under Advanced settings, look for an option called “Hide protected operating system files (Recommended)“. By default, this option is enabled and you will not be able to see the pagefile.sys as well as other operating system files in any drive. If the option is disabled, you will be able to view the pagefile.sys in the root of the drive where page file exists.

Hide protected operating system files

How to delete pagefile.sys in Windows 11

You cannot directly delete the pagefile.sys file in the usual way. When you try to do so, Windows will prompt you an error that says the action can’t be completed because the file is open in another program. Related read: How to Force Delete a File in Use by Another Program on Windows 11.

In order to delete the pagefile.sys, you need to set “no paging file” for the drive so that Windows will not allocate any disk space as page file for the selected drive, thus, removing the pagefile.sys from the drive. To manage page file in Windows 11, follow the steps below.

  1. In This PC where you can view all your drives, right-click anywhere in the file explorer window and select Properties. Alternatively, you can press Win + i to open Settings and navigate to System > About.System Properties Windows 11
  2. In the About settings, click Advanced system settings in the “Related links” section.Advanced system settings Windows 11
  3. In the System Properties window, select the Advanced tab and click Settings under Performance.Windows 11 Performance Settings
  4. Next, select Advanced tab and click Change under Virtual memory.Change Virtual Memory Windows 11
  5. Here is where you can manage the page file for all your drives. If you have the “Automatically manage paging file size for all drives” option enabled, Windows will handle everything about page file for you and you won’t be able to change any of the settings. To manually change the page file settings, uncheck the option first.
  6. To delete the pagefile.sys from a drive, you need to set the drive as “No paging file”. To do so, first select the drive from the “Paging file size for each drive” section.
  7. Next, select “No paging file” and click Set.How to Delete Pagefile.sys in Windows 11
  8. Click OK to save the changes and restart your computer for the changes to take effect.

Read next: Delete Windows.old Folder in Windows 11

As mentioned previously, Windows may be unstable if you disable page file entirely for all drives. Apps may start to crash randomly when your RAM reaches near its limit.

It’s best to at least set a certain amount of paging file size for at least one drive for Windows 11 to work stably. It’s recommended that you select the “System managed size” option for at least one of your drives.

System managed size page file Windows 11

How to reduce the size of pagefile.sys

If you have a pagefile.sys that is too huge in size, you can manually change the paging file size by following the steps above until step 7. Instead of choosing “No paging file”, you can select Custom size and enter your desired paging file size for the selected drive. In most cases, it’s recommended to set the same size for both Initial and Maximum size.

how to reduce pagefile.sys size Windows 11

Alternatively, you can just select the “System managed size” option to allow Windows to automatically allocate the paging file size for the selected drive. This way, you don’t have to worry about sizing your pagefile manually.

Categories: DiskWindows 11

Nyau Wai Hoe
Nyau Wai Hoe is the Founder and Chief Editor of WindowsDigitals.com. With a degree in software engineering and over 12 years of experience in the tech support industry, Nyau has established himself as an expert in the field, with a primary focus on the Microsoft Windows operating system. As a tech enthusiast, he loves exploring new technologies and leveraging them to solve real-life problems.

Share via
Copy link