Windows is known to create virtual memory for the operating system in case the built-in memory is insufficient.
Windows uses a .sys paging file for this.
But since Windows 8, Microsoft has introduced a new file along with pagefile.sys and hiberfil.sys, Swapfile.sys.
What are Pagefile.sys, Hiberfil.sys and Swapfile.sys?
To run programs and other applications, Windows will use RAM. When the number of programs exceeds the built-in memory capacity, Windows creates a Pagefile.sys.
Pagefile.sys is usually stored in the C drive of your PC. Windows will start allocating memory to this file when the RAM starts running out of space.
Likewise, hiberfil.sys is the file that Windows sends all its RAM memory to when it puts your machine into hibernation mode.
Swapfile.sys, on the other hand, has little information available from official sources.
Although in summary, it satisfies the need for the new way to use and experiment with applications introduced by Windows, The Universal Apps or many other similar names.
Windows will use Swapfile.sys to send application bits to the file, which will be stored for later use and smoother operation.
This is essentially Microsoft's attempt to make the Windows experience leaner, faster, smoother, and easier to use.
This separate memory management system for Metro Apps should make Windows run smoother and perform better.
How to get rid of Swapfile.sys?
For starters, Swapfile.sys isn't great. The normal size of Swapfile.sys on a system running Windows 10 is approximately 256MB, maximum.
Note: If you're trying to free up space on a tablet, it probably won't be that big and will likely make your device smoother and more agile.
Swapfile.sys is managed together with Pagefile.sys by Windows.
Disabling the use of the page file for a partition will also disable Swapfile.sys.
Disabling the page file is NOT recommended at all. This can dramatically slow down your PC, hinder the performance of your machine, and in rare cases can even cause a fatal problem with the operating system.
On the other hand, Swapfile.sys can be disabled from your PC by disabling the paging file.
How do I disable the paging file for a particular drive?
Note: This is NOT recommended, if you notice any performance issues, you should undo the changes as soon as possible.
1- Right-click the Start button and open the Start menu or press Windows key + x together .
2- Open the control panel.
3- Search and select -Optimize the appearance and performance of Windows.
4- Windows will now show you the options window.
5- Select the Advanced tab.
6- Under the Virtual Memory option, click Change.
7- Uncheck the first checkbox that says - Automatically manage paging file size for all drives.
8- Now select the drive where you want to disable the paging file, among the visible options.
9- Once you have chosen the drive, select No paging file.
10- Click on Set.
11- Select ok and exit the window.
12- Restart the machine.
You have now disabled the paging file on the selected device and removed Pagefile.sys and Swapfile.sys.
How to delete the swap file using the registry
1. Press Tasto Windows + R key together to open the run.
2. Write regedit on it and click OK.
Final report: - It is always best to first do anything in the registry to create a backup
3. Go to the following path in the registry editor.
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerMemory Management
4. Now on the right side, right-click on an empty space and create a 32-bit DWORD key with the name SwapfileControl.
5. Double click SwapfileControl and set the value data to 0.
6. Close the registry editor e start again.