What is Swapfile.sys and How Do You Delete It?

what-is-swapfilesys-and-how-do-you-delete-it photo 1

Windows 10 (and 8) include a new virtual memory file named swapfile.sys. It’s stored in your system drive, along with the pagefile.sys and hiberfil.sys. But why does Windows need both a swap file and a page file?

Windows swaps out some types of data that aren’t being used to the swap file. Currently, this file is used for those new “universal” apps — formerly known as Metro apps. Windows may do more with it in the future.

what-is-swapfilesys-and-how-do-you-delete-it photo 2

Swapfile.sys, Pagefile.sys, and Hiberfil.sys

Like pagefile.sys and hiberfil.sys, this file is stored in the root of your system drive — C:\ by default. It’s also visible only if you’ve enabled “Show hidden files and folders” and if you have the “Hide protected operating system files” option disabled.

Hiberfil.sys is used by the Windows operating system to store all the contents of your RAM during hibernation. It also helps enable the new “hybrid boot” fast booting feature in Windows 8 and 10. Pagefile.sys is where the Windows operating system pages out memory when there’s no room left in your RAM and the system needs more RAM.

What is the Swap File For?

There’s not a lot of official Microsoft information about this file out there, but we can piece together an answer from official Microsoft blog posts and forum responses.

In summary, the swapfile — swapfile.sys — is currently used for swapping out Microsoft’s new style of app. Microsoft has called these universal apps, Windows Store apps, Metro apps, Modern apps, Windows 8 apps, Windows 8-style UI apps, and other things at various points.

These apps are managed differently from traditional Windows desktop apps. Windows manages their memory more intelligently. Here’s how Microsoft’s Black Morrison explains it:

“You may ask, ‘Why do we need another virtual page file?’ Well, with the introduction of the Modern App, we needed a way to manage their memory outside of the traditional Virtual Memory/Pagefile method.

“Windows 8 can efficiently write the whole (private) working set of a suspended Modern app to disk in order to gain additional memory when the system detects pressure. This process is analogous to hibernating a specific app, and then resuming it when the user switches back to the app. In this case, Windows 8 takes advantage of the suspend/resume mechanism of Modern apps to empty or re-populate an app’s working set.”

Rather than using the standard pagefile.sys file for this, Windows swaps out bits of universal apps that are no longer necessary to the swapfile.sys file.

Microsoft’s Pavel Lebedinsky explains a bit more:

“Suspend/resume of Metro-style apps is one scenario, there could be others in the future.

The swapfile and the regular pagefile have different usage patterns and different requirements with regard to space reservation, dynamic growth, read/write policies etc. Keeping them separate makes things simpler.”

Essentially, the standard page file is used for the normal things in Windows, while the Microsoft’s new app framework uses a separate type of file for intelligently swapping out bits of new apps.

what-is-swapfilesys-and-how-do-you-delete-it photo 3

 

How Do I Delete the Swapfile.sys File?

This particular file is actually quite small, and should be about 256 MB in size at the most. You shouldn’t need to remove it. Even if you have some sort of tablet with a very low amount of storage, the swapfile.sys probably helps make it more responsive.

The swapfile.sys file is managed along with the pagefile.sys file. Disabling the paging file on a drive will also disable the swap file on that drive.

We really don’t recommend doing this, as disabling your page file is a bad idea.

But you can remove this file, if you like. To access the appropriate dialog, open the Start menu, type “performance”, and select the “Adjust the appearance and performance of Windows” setting shortcut.

what-is-swapfilesys-and-how-do-you-delete-it photo 4

In the Performance Options window, click the Advanced tab and click the Change button under Virtual memory.

what-is-swapfilesys-and-how-do-you-delete-it photo 5

Uncheck “Automatically manage paging file size for all drives,” select a drive, select “No paging file,” and click “Set.” Both the pagefile.sys and swapfile.sys files will be removed from that drive after you reboot your computer.

You should be able to recreate a page file on another drive from here and Windows will move your virtual memory files to that drive, allowing you to reduce wear on a solid-state drive and put them on a mechanical hard drive, for example.

what-is-swapfilesys-and-how-do-you-delete-it photo 6

Click OK and reboot your PC. The swapfile.sys and pagefile.sys files should vanish from your drive. To recreate them, visit this dialog again and enable a system managed size on your C:\ drive or another drive.


Overall, this file isn’t too bad — it’s a new file, but it takes up much less space than the traditional pagefile.sys and hiberfil.sys files. Windows 10 should use less disk space than Windows 7, even with this additional virtual memory file.

More stories

How to Make Windows Hibernate More Often (Instead of Sleep)

By default, Windows will automatically put your PC to sleep after several minutes of inactivity, or when you close the lid. It will hibernate your computer a certain number of minutes later, but if you’d rather it hibernate more often, the settings are a bit tricky to find.

Switch (Networking)

If you need to connect multiple wired devices to your network–such as a laser printer, computer, DVR, and so on–you need a switch. A network switch is a telecommunication device that relays messages from devices connected to it and then transmits them only to the specified receiving device on the

10 Android Tweaks That Still Require Root

Many features that once required root have been added to Android over the years. However, many advanced tricks still require rooting your Android smartphone or tablet.

How to Unlock Your Computer with Your Phone or Watch

Everyone wants to replace the password with something better. Well, we already have smartphones — and some of us even have smartwatches. These tools can log you into your computer with a smartphone or smartwatch.

How the Modern Interface is Improved in Windows 8.1

Microsoft is restoring the Start button and adding a boot-to-desktop option in Windows 8.1, but they aren’t giving up on the Modern interface. The Modern interface has been dramatically updated, and it no longer feels quite as half-baked.

How to Share Your Plex Media Library with Friends

You’ve invested a lot of energy gathering and curating so many great movies and TV shows in your Plex Media Server, wouldn’t it be great if you could share all that content with your friends? With a few small tweaks, you can–we’ll show you how.

How and Why to Encrypt Your Text Messages

With the NSA peering into everyone’s pockets without permission, and nosy siblings snooping through your message history while you’re away, there has never been a better time to start encrypting your text messages than there is today.

What is a TPM, and Why Does Windows Need One For Disk Encryption?

BitLocker disk encryption normally requires a TPM on Windows. Microsoft’s EFS encryption can never use a TPM. The new “device encryption” feature on Windows 10 and 8.1 also requires a modern TPM, which is why it’s only enabled on new hardware. But what is a TPM?