Should You Delete pagefile.sys?
In this article
No, you should not delete pagefile.sys. It is a core Windows system file that provides virtual memory, letting your PC use part of the hard drive or SSD as an overflow for RAM. Deleting it can cause system instability, crashes, or prevent Windows from starting, and it will be recreated automatically on reboot anyway.
What Is pagefile.sys?
Pagefile.sys is the Windows swap file, also called the paging file. It sits in the root of your system drive (usually C:\pagefile.sys) and acts as a temporary data store for memory pages that are not being used actively. When your physical RAM is full, Windows moves less‑critical data from RAM into the pagefile, freeing up memory for the programs you are currently using. This is why it is referred to as virtual memory.
Windows manages the pagefile automatically by default. It can grow and shrink as needed, though it is typically set to a size between 1.5 and 3 times your RAM, depending on your system and usage. On a machine with 8 GB of RAM, the pagefile might be around 4–12 GB, but the exact size varies.
Why You Should Not Delete It
Deleting pagefile.sys manually is not a supported operation. Windows locks the file while it is in use, so you cannot simply right‑click and delete it from File Explorer. Even if you force‑delete it via a bootable USB or a third‑party tool, the system will recreate it the next time it boots. More importantly, removing the pagefile can lead to:
- Out‑of‑memory errors when RAM is exhausted, because there is no fallback storage.
- Application crashes, especially memory‑intensive software like video editors or browsers with many tabs.
- System instability or a Blue Screen of Death (BSOD) in extreme cases.
- Inability to create crash dumps – Windows uses the pagefile to write memory dump files when a system error occurs, which are essential for diagnosing problems.
The common misconception is that deleting the pagefile frees up disk space and speeds up the PC. In reality, the space is reserved for a reason. If you disable it, you lose a safety net, and the performance gain is negligible on modern hardware.
When You Might Want to Change It
There are legitimate reasons to adjust the pagefile settings, but not to delete the file entirely. For example, if you have a very small system drive (like a 64 GB SSD) and the pagefile is consuming several gigabytes, you might move it to another drive or reduce its size. You can also set a custom size to prevent it from growing unpredictably.
However, disabling the pagefile entirely is only recommended for advanced users who have a very large amount of RAM (e.g., 32 GB or more) and run only a few specific applications that do not rely on virtual memory. Even then, Windows will still require a paging file for crash dumps, so you would need to set a small dedicated dump file. For the vast majority of users, leaving the pagefile on automatic is the best choice.
How to Safely Adjust or Move It
If you still want to change the pagefile size or move it to another drive, follow these steps. Note that labels may differ slightly by Windows version (Windows 10/11).
- Press Win + R, type
sysdm.cpl, and press Enter. - Go to the Advanced tab and click Settings under Performance.
- In the Performance Options window, switch to the Advanced tab and click Change under Virtual memory.
- Uncheck Automatically manage paging file size for all drives.
- Select your system drive (C:) and choose Custom size. Enter an initial and maximum size (e.g., 1024 MB and 4096 MB), or choose System managed size to let Windows decide.
- To move it to another drive, select the new drive and set a custom size, then select the original drive and choose No paging file.
- Click Set, then OK. You will need to restart your PC for changes to take effect.
Warning: Moving the pagefile to a different drive is fine, but do not disable it on all drives unless you are certain you do not need virtual memory. If you set “No paging file” on every drive, Windows will warn you that a crash dump cannot be created.
Common Problems and Misconceptions
One frequent question is: “Why is my pagefile.sys so large?” It can grow to several gigabytes, especially if you run memory‑heavy applications or have a small RAM. The file is also used for memory‑mapped files and can be larger than your RAM. You can check the current size in the Virtual Memory dialog.
Another myth is that deleting the pagefile will speed up an SSD. In reality, the pagefile is written to only when RAM is full. If you have enough RAM, the pagefile is rarely used, so deleting it has no performance benefit. On the other hand, having a pagefile on an SSD is actually good because SSDs are fast and can handle the I/O.
Some users also worry about privacy, thinking the pagefile contains sensitive data. While it can contain remnants of data that was swapped out, Windows encrypts the pagefile by default on systems with BitLocker or device encryption. If you are concerned, you can enable the “ClearPageFileAtShutdown” policy, but this is unnecessary for most home users.
Alternatives to Deleting Pagefile.sys
If your goal is to free up disk space, there are safer alternatives:
- Run Disk Cleanup to remove temporary files and system junk.
- Uninstall unused programs or move them to another drive.
- Disable Hibernation if you do not use it – this frees up a file called
hiberfil.syswhich is often as large as your RAM. - Compress the pagefile – Windows 10/11 can compress the pagefile to save space, but this is not a standard user setting.
If you are running low on RAM, the best solution is to add more physical memory or close memory‑hungry applications. The pagefile is not a substitute for RAM; it is a fallback.
Frequently Asked Questions
Can I delete pagefile.sys to free up space?
No. Even if you manage to delete it, Windows will recreate it on the next boot. The space is reserved for virtual memory, and removing it can cause system errors. Instead, use Disk Cleanup or move the pagefile to another drive if space is tight.
Is it safe to disable the pagefile if I have 16GB or 32GB of RAM?
It is generally safe to disable it if you have a very large amount of RAM and never run out. However, Windows still needs a paging file for crash dumps. If you disable it completely, you may not get a memory dump on a BSOD, which hampers troubleshooting. It is better to set a small fixed size (e.g., 512 MB) than to disable it entirely.
Why does pagefile.sys keep coming back after I delete it?
Because Windows needs it for virtual memory. The system recreates it automatically at boot. You cannot permanently delete it through normal means. The only way to prevent it is to disable the pagefile in the Virtual Memory settings, but as mentioned, that is not recommended.
Does pagefile.sys slow down my computer?
Only if you are running out of RAM and the system is constantly swapping data to disk. On a modern PC with sufficient RAM, the pagefile is rarely used, so it has no noticeable impact on performance. If you see frequent disk activity and sluggishness, you likely need more RAM, not a deleted pagefile.
Can I move pagefile.sys to another drive?
Yes, you can move it to a different drive (e.g., a secondary HDD or SSD) by changing the virtual memory settings. This can help if your system drive is low on space. However, if the other drive is slower, it may reduce performance. For best results, put it on an SSD.