- Swapfile.sys works in conjunction with pagefile.sys and hiberfil.sys for Windows memory and hibernation.
- Its size varies depending on the load and space; fluctuations after restarting are normal.
- Deleting or moving requires adjusting virtual memory; not recommended for stability and performance reasons.
- To free up space, start by disabling hibernation and keeping your system updated.
Many users are unaware of the usefulness, or even the existence, of the swapfile.sys files on WindowsThis file shares the spotlight with pagefile.sys and hiberfil.sys, and together they are part of memory management and functions like hibernation in Windows. Although they are usually hidden, their presence and size can affect your drive space, especially if you use a low-capacity SSD.
Here we explain exactly what swapfile.sys is and how to view it. We also cover when and how to delete or move it (with some nuances), and its relationship to UWP apps and other system components.
What is swapfile.sys and how does it differ from pagefile.sys and hiberfil.sys?
Roughly, swapfile.sys is a swap file that Windows uses to support RAMIt works in conjunction with pagefile.sys (pagination file) and hiberfil.sys (hibernation file). While hiberfil.sys saves the system state during hibernation, pagefile.sys extends memory when RAM is insufficient, and swapfile.sys is primarily reserved for the Background management of UWP applications (those you install from the Microsoft Store), serving as a kind of specific cache for them. Even if you have enough memory, Windows 10 and 11 can still use swapfile.sys.
An important detail: pagefile.sys and swapfile.sys are linkedYou can't delete one and leave the other intact using conventional methods; management is coordinated through the virtual memory configuration. Therefore, It is not possible to send them to the Recycle Bin using either Delete or Shift+Delete.because they are protected system files.
If you don't see them in C:, it's because Windows hides them by default. To show them, do this:
- Open Explorer and go to Vista.
- Choose Options.
- Click on Watch.
- There, select “Show hidden files, folders, and drives” and uncheck “Hide protected operating system files (Recommended)".
Once this is done, pagefile.sys, hiberfil.sys and swapfile.sys will appear in the root of the system drive.
Is it normal for its size to change after a restart?
The short answer is that Yes, it's normal.Windows dynamically adjusts the size of virtual memory and swap space based on load, recent RAM usage history, available space, and internal policies.
In addition, it's worth remembering that "Shut down" in Windows 10/11 uses a default hybrid start/stop which doesn't always fully download the system state. If you want virtual memory changes to be applied 100% and for sizes to be properly reset, choose Restart instead of Turn Off.
In tools like TreeSize You'll see those ups and downs: They do not indicate errors.It's not simply the operating system's intelligent management of space. As long as you don't experience crashes or low memory messages, don't worry if the size fluctuates between sessions.
Can I delete swapfile.sys? Pros and cons
It's possible, but It's not the most advisable thing to do.The main reason is that swapfile.sys doesn't usually take up much space. On modern computers, removing it also involves adjusting virtual memory settings, which can cause instability, unexpected crashes, or problems with UWP appsEspecially if you have 16 GB of RAM or less. In some cases, the space savings are modest and the operational risk is greater.
Having said that, if you are sure you do not use UWP apps Or if you urgently need to squeeze every last bit of storage out of a tiny SSD, there are ways to disable the swap fileWe show you the available options, with their warnings, so you can assess whether they are worthwhile in your situation.
How to delete swapfile.sys by disabling virtual memory (standard method)
This is the “official” method, because Windows does not allow manual deletion. swapfile.sys. The idea is to disable virtual memory, which in practice remove pagefile.sys and swapfile.sysIt is not recommended for computers with limited RAM.
- Open Explorer, right-click on This team and press Properties.
- Sign in Advanced System Settings.
- In the AdvancedIn Performance, press Configuration.
- Again in Advanced, locate Virtual memory and press Change.
- Uncheck “Automatically manage paging file size for all drives".
- Select your system unit and mark No paging file.
- Balance Establish and confirms the warnings.
- Apply with Accept until we're out of every window.
For suppression to be effective, restart the computer From the Restart option (not Shut Down). After startup, you should check that pagefile.sys and swapfile.sys They have disappeared from the root of C: if you have disabled paging on all drives.
Advanced deactivation via Registry (risky procedure)
Another specific option involves tapping the Registry to Disable swapfile.sys without completely disabling virtual memoryThis method is reserved for users who know what they are doing, because modifying the Registry can cause problems if mistakes are made.
Important warningYou need administrator privileges, and it's a good idea to create one first. restore point.
- Press Windows + R, writes regedit and press Enter.
- Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management - Create a new DWORD value (32 bits) called SwapfileControl.
- Open it and set it up Data value = 0.
- Reboot The computer and check if swapfile.sys has disappeared.
If you prefer to automate it with PowerShell or Terminal (as administrator):
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name SwapfileControl -Value 0 -PropertyType DWORD -Force
To revert, delete the value SwapfileControl on the same key and restart. Keep in mind Although this usually works, It's not always the ideal solution. if you depend on apps from the Microsoft Store.
Can swapfile.sys be moved to another drive?
Here we need to be subtle with the nuances. mklink command does not move swapfile.sysIt creates a symbolic link, but the actual file remains where it was. Therefore, Using links won't work to transfer it to another partition.
What you can do is reconfigure virtual memoryIn many scenarios, when moving pagefile.sys to another drive from the same Virtual Memory window, swapfile.sys accompanies to that change. However, some users report that swapfile.sys can remain on the system drive in certain versions or configurations. In any case, the official procedure to try it is this:
- Accede to Advanced System Settings > Unlimited > Configuration > Advanced > Virtual memory.
- Uncheck “Manage automatically…".
- Select the system drive (C:) and check No paging file > Establish.
- Choose the destination drive (for example, D:) and select System-managed size > Establish.
- Confirm with Accept y restart.
Watch out for performanceIf you move these files to a slower disk (an HDD), you may notice slowdownsespecially when opening or resuming UWP applicationsThe potential improvement in SSD lifespan is debatable compared to the performance impact; carefully consider the upgrade.
More disk space: hibernation and maintenance
If your goal is free up space Without compromising stability, there are safer ways to do this than tinkering with virtual memory. For example, you can disable hibernationThis removes hiberfil.sys and frees up several GB on many computers:
powercfg -h off
In addition, it is advisable for you to perform a certain periodic maintenance Recommended by Microsoft to improve overall system stability and reduce unusual disk space behavior:
- Scan with Windows Defender (including offline scanning) to rule out malware that manipulates system files.
- It restarts frequently From the Restart option, the system closes processes and applies pending changes.
- install updates from Windows Update to get fixes and improvements.
- If you notice conflicts, temporarily disables third-party antivirus software to check if they interfere and let Defender cover you while you test.
- Repair components with DISM y SFC from a privileged console:
DISM.exe /Online /Cleanup-Image /RestoreHealth
sfc /scannow
If everything works smoothly after this, You will avoid more drastic measures with virtual memory and you will continue to recover space without unnecessary risks.
FAQ and common scenarios
- Can I delete swapfile.sys "manually" from Explorer? No. It's protected by the system. Windows won't let you remove it outright. You'll have to go through the virtual memory settings or use the Registry method if you understand the risks.
- Is it mandatory to have a swapfile if I don't use UWP apps? Not strictly, but Windows can take advantage of it even if you're not using UWP. If you disable it, thoroughly test your applications after restarting to ensure there are no side effects.
- Is it worth moving pagefile/sys and swapfile.sys to an HDD to "protect" the SSD? The evidence is mixed: moving them to a slower drive reduces performance, especially in UWP. Modern SSD wear is generally well controlled; unless you're severely short on space or have very specific reasons, keeping them on the SSD is usually the best option.
- What should I do if I experience crashes after using virtual memory? Re-enable automatic management in Virtual Memory, restart, and test. If the problem persists, run DISM and SFC, check drivers, and ensure no security software is interfering.
- How can I quickly see if the system is using them? Beyond Explorer, Resource Monitor and Task Manager give you clues about commitment to memory and the use of virtual memory. The fact that the file exists and occupies a certain size does not imply constant use; Windows manages it dynamically.
If you were trying to understand why, after a restart, your free space skyrocketed and the "page file" transformed into a tiny swapfileYou already have the key: Windows recalculated its needs and adjusted the virtual memory size. Between showing or hiding these files, deciding whether to disable them, move them, or save space by hibernating, the sensible thing to do is just enough to playStart by disabling hibernation if you need to free up gigabytes, keep your system updated and clean, and only adjust pagefile.sys and swapfile.sys if you know exactly what you're doing and accept the possible impact on stability or performance.
Editor specialized in technology and internet issues with more than ten years of experience in different digital media. I have worked as an editor and content creator for e-commerce, communication, online marketing and advertising companies. I have also written on economics, finance and other sectors websites. My work is also my passion. Now, through my articles in Tecnobits, I try to explore all the news and new opportunities that the world of technology offers us every day to improve our lives.

