Many who have tried to free up space in Windows 10 will have come across an abnormally large file and instantly wondered how to delete pagefile.sys. The paging file in Windows 10 can take up to 32 GB and is usually a significant storage drain on small SSDs.
What is pagefile.sys used for in Windows and can I delete pagefile.sys?
Before you do anything drastic, it’s worth explaining exactly what the pagefile is. The paging file in Windows 10 is a form of virtual memory, often used when you open an app and your PC already has more apps than it can handle. When the new program starts, the old ones are essentially backed up from the RAM to your hard drive to make sure you don’t lose any information when they’re pushed out of RAM.
This is a useful feature and many crash logs are stored in the paging file, but it can also be a small security vulnerability. By default, pagefile.sys retains information after the computer is shut down, which can potentially give an attacker more information than you intend.
As a result, we’re going to be showing you how to delete pagefile.sys on shutdown. However, note that we won’t be covering how to delete pagefile.sys permanently today. For that, you can check our previous tutorial about optimizing virtual memory. Let’s get started:
How to Delete Pagefile.sys on Shut Down via Registry Entry
Remember that editing your registry can be dangerous if you don’t take precautions. Please read our safe Registry editing guide before you continue.
- Open Registry Editor
- Navigate to the memory management Registry key
- Enable the “ClearPageFileAtShutDown” entry
After selecting the Memory Management folder, search for a DWORD named “ClearPageFileAtShutdown” and double click it. Change its “Value data” to “1” and press “OK”. Restart your PC to check if the page file resets.
How to Delete Pagefile.sys on Shutdown with an Automatic .Reg File Entry
Those who trust we have their best interests at heart can skip the manual registry entry and use our pre-configured .reg file to do it for them. You can download it here. Extract it before continuing.
- Run the .reg file
- Accept the UAC prompt
- Click “Yes”
- Press “OK”