What Is Swapfile.sys in Windows, and Can You Delete It?

When your Windows computer is running out of RAM, it transfers some of its temporary data to certain files on your storage drive. One of these files is known as Swapfile.sys. But what is this file, and can you delete it to save disk space on your Windows machine?

Here’s what you need to know about Swapfile.sys.

4

What Is Swapfile.sys?

Swapfile.sys is a system file that stores app data that Windows does not need in physical RAM at the moment. And if you’re not sure what “RAM” is, it’ll be a good idea to check out ourquick and dirty guide to RAMso you’re all caught up to speed.

Together with the Pagefile.sys and Hiberfil.sys files, Swapfile.sys forms what is known as virtual memory. Virtual memory is a way for Windows to use the computer’s storage drive to artificially extend its RAM capacity.

The delete button

Swapfile.sys doesn’t store regular app data. It handles data from Universal Windows apps, which are programs built to run on Microsoft’s ecosystem of devices, such as PCs, smartphones, tablets, smartwatches, and Xbox consoles. Windows stores temporary data for traditional apps in Pagefile.sys.

Without Swapfile.sys, you’ll notice some Universal Windows apps you’ve installed becoming slow to respond or even crashing when RAM is low.

the appearance and personalization window in control panel on windows

Where Is Swapfile.sys Located on Windows?

Swapfile.sys is located on your local storage drive (C:), but it’s hidden by default since it’s an important system file. That means you’ll have to reveal it in Folder Options.

To do that, follow the steps below:

The unhide protected os files option in folder options

If you want to hide it again, just uncheck the radial button and checkbox mentioned in step 5 above.

Can You Delete Swapfile.sys?

Yes, you can delete Swapfile.sys, but you can’t do so directly. Swapfile.sys is always being used by Windows, so if you try to delete it normally, you’ll be met with an error message telling you that “this action cannot be completed because the file is open in another program.”

However, if you are looking to delete it to save space on your storage drive, there’s really no need, as the file is small. On our system, it was about 16MB, which isn’t a lot of space that can have a significant impact on your storage needs. This is the typical size of the file on most systems.

windows swapfile.sys in the local drive

But if you’re adamant about deleting Swapfile.sys or just want to know how it can be done, there’s a workaround.

How to Delete Swapfile.sys

To delete Swapfile.sys,you’ll have to delete Pagefile.sys, as the former is linked to the latter. Once you remove Pagefile.sys, the Swapfile.sys file will vanish alongside it.

However, we advise against deleting Pagefile.sys, as it can negatively impact your PC’s performance. The only scenario where it would be okay to delete it is if you have at least 16GB of RAM installed on your computer. That way, Windows has enough physical memory that it probably won’t need to offload any data during ordinary use.

Demystifying Swapfile.sys and What it Does

So, Swapfile.sys is the file Windows uses to store temporary data from Windows Universal apps. It’s an important file and should not be deleted unless you know you have a lot of RAM to spare.

If you learned about Swapfile.sys because you were searching for ways to clear space on your storage drive, there are better ways of going about it.

Need to clear some room on your Windows computer? Here are the Windows files and folders that can be safely deleted to free up disk space.

My foolproof plan is to use Windows 10 until 2030, with the latest security updates.

Not Linux, not Windows. Something better.

Tor spoiled me forever.

Taming data is easier than it looks.

Your phone is a better editor than you give it credit for.

Technology Explained

PC & Mobile