How to delete a pagefile.sys or resize it

The Windows key being pushed on a blue laptop
(Image credit: Shutterstock)

Learning how to delete a pagefile.sys can be a seriously handy trick for users, especially considering your PCs performance can be adversely affected by huge files that reside in your hard drive’s storage. 

Pagefile.sys is responsible for the storage of data needed by the PC, but can’t be handled by the machine’s random access memory (RAM), usually because it has hit or is nearing capacity. 

Otherwise known as ‘virtual memory’, a huge pagefile.sys can indicate that it might be time to upgrade the system’s RAM and that virtual memory is being relied on too heavily.

Virtual memory is only used when RAM reaches its limits and only the least-used data that are typically held in RAM is sent there, usually. Regardless of whether your pagefile.sys file is located on an HDD or solid state drive (SSD), it’s a good idea to keep some disk space available in case virtual memory is required to keep everything running. 

Pagefile.sys can become bloated quickly, resulting in performance slowing. If you’re coming across the file for the first time and are not experiencing any performance issues, then the file itself can often be shrunk, freeing up space for other storage needs.

How to delete a pagefile.sys in three easy steps

Luckily, deleting a pagefile.sys is a fairly straightforward process that can be done in a matter of minutes. 

This guide will run you through the three easy steps to achieve this, and breathe fresh air into your struggling device.

Step 1: Locate pagefile.sys

Because pagefile.sys plays such an important role in the smooth running of Windows, by default it’s hidden to the user to prevent accidental deletion. This means that finding the file requires a little more effort than simply launching Windows Explorer and searching for it in the text field.

Here's how it's done:

  • Visit the Control Panel
  • Click Advanced System Settings
  • Head to the Performance section 
  • Visit Settings, then the Advanced tab

At the bottom of the next window, you should see a Virtual memory section, complete with the amount of virtual memory that your operating system (OS) has allocated for your pagefile.sys file.

Step 2: Remove pagefile.sys

To make any fixes, select the Change button, and then take a look at the options in the next window. 

To remove your pagefile.sys altogether, just make sure the no paging file box is ticked. Accept the changes and this will free up disk space.

Step 3: Force pagefile.sys to remain one size

You may find that you need virtual memory, but you can stop things from getting out of hand. 

To reduce the amount of space your PC will allocate for virtual memory, just deselect Automatically manage paging file size of each drive and, instead, select the custom size option. 

After that, you’ll be able to input just how much of your HDD will be reserved for virtual memory.

Connor Jones
News and Analysis Editor

Connor Jones has been at the forefront of global cyber security news coverage for the past few years, breaking developments on major stories such as LockBit’s ransomware attack on Royal Mail International, and many others. He has also made sporadic appearances on the ITPro Podcast discussing topics from home desk setups all the way to hacking systems using prosthetic limbs. He has a master’s degree in Magazine Journalism from the University of Sheffield, and has previously written for the likes of Red Bull Esports and UNILAD tech during his career that started in 2015.