If you turn off the “Hide protected operating system files” in Folder Options and take look your system drive (usually C drive) in File Explorer, you will probably notice a system file called swapfile.sys sitting along with the pagefile.sys and hiberfil.sys file, and eating up a few hundred MB of your storage space. You may wonder what it is and why Windows need both a page file and a swap file.
What is the Swap File for?
In a nutshell, this swapfile.sys file is a new virtual memory file first introduced in Windows 8 for Microsoft’s new style of the app, Modern Apps in Windows 8 or Universal Apps in Windows 10. As we all know, one of the most important features in Modern Apps is that these apps can be suspended when the system is running low in memory. And when that happens, Windows 8/10 can efficiently write the whole working set of a suspended app to disk in order to gain additional memory, more specifically, it writes the data into this swap file on your system drive.
Since the swap file 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, explained by Pavel Lebedinsky at Microsoft in a post on Technet Forum.
The file is a system file, therefore, it’s hidden by default. To view the file, go to View → Options → Change folder and search options in File Explorer, uncheck the option “Hide protected operating system files“.
Can I delete it?
Yes, you can delete it but you shouldn’t. First of all, the file isn’t that big. And secondly, it’s managed along with the page file in Windows. Disabling page file in System Properties will also delete the swap file on that drive. Since disabling page file usually is a bad idea, you probably should leave both pagefile.sys and swapfile.sys along and let them do their job.