Use Caution

Is It Safe to Delete swapfile.sys?

Quick Answer: swapfile.sys is a critical Windows system file used as virtual memory for Universal Windows Platform (UWP) apps. It should not be deleted manually.

What is swapfile.sys?

swapfile.sys is a hidden operating system file located at the root of your C:\ drive. It sits right next to its more famous siblings, pagefile.sys and hiberfil.sys.

Why Does It Exist?

Introduced in Windows 8, swapfile.sys is a specialized form of virtual memory. While pagefile.sys handles memory swapping for traditional desktop software (like Chrome or Photoshop), swapfile.sys is used exclusively for Universal Windows Platform (UWP) apps—these are the modern, sandboxed apps you download from the Microsoft Store, along with built-in Windows features like the Start Menu and Cortana.

When Windows needs to pause a modern app or put it to sleep in the background, it rapidly writes its memory state into swapfile.sys to free up your physical RAM for other tasks.

Can You Delete It?

No, you cannot and should not delete it manually.

Because it is an active, protected system file in constant use by the Windows kernel, any attempt to simply right-click and delete swapfile.sys will be blocked by a “File In Use” error. Even if you manage to force-delete it using third-party tools, your modern Windows apps (including the Start Menu) will likely crash or freeze.

How to Safely Remove It

If you absolutely must remove it, you have to tell Windows to stop generating it by completely disabling the paging file. (Warning: This is not recommended unless you have a massive amount of RAM, e.g., 64GB+).

  1. Press Win + S, type Advanced system settings, and press Enter.
  2. Under the Performance section, click Settings.
  3. Go to the Advanced tab and click Change… under Virtual memory.
  4. Uncheck “Automatically manage paging file size for all drives”.
  5. Select your C:\ drive, click No paging file, and click Set.
  6. Restart your computer. Both pagefile.sys and swapfile.sys will vanish.

What Happens If You Delete It?

If you disable it safely using the method above, you will reclaim about 256MB of storage space. However, your modern Windows apps will no longer be able to cleanly suspend themselves in the background, which could lead to increased physical RAM usage and potential system instability if you run out of memory.

Bottom Line

Leave swapfile.sys alone. It only takes up a tiny 256MB of space, and it is a critical component for keeping your Start Menu and Microsoft Store apps running smoothly in the background.

Discussion

Loading authentication...

Related in windows

Chia Blockchain Mainnet Database (~/.chia/mainnet/db)

The Chia mainnet db folder stores full node blockchain blocks (blockchain_v2_mainnet.sqlite). Deleting forces re-sync.

Use Caution

How to Force Delete a Locked File or Folder in Windows 11 / 10

Fix 'The action cannot be completed because the file is open in another program' with Command Prompt, PowerShell, and Task Manager.

Safe to Delete

Why Is My Hard Drive Full But No Files Are Showing? (Hidden Bloat Solved)

Fix hard drives that appear full despite selecting all files showing low storage. Discover hidden shadow copies, System Volume Information, and pagefiles.

Safe to Delete
Back to all files