Skip to contentGo to the directory tree
  1. C:
  2. swapfile.sys
FileRisk: Caution
  • Hidden

swapfile.sys C:\swapfile.sys

swapfile.sys: swap file reserved for Store apps, separate from pagefile.sys. Hidden at the root of the system volume and managed by Windows.

Updated on By AltF4 Formation

What it’s for

swapfile.sys arrived with Windows 8 and Windows Server 2012 for Store (modern) apps. Windows moves the memory of suspended apps into it and brings it back quickly when you switch to them. It complements pagefile.sys, which serves the system and desktop applications. The AskPerf article “Windows 8 / Windows Server 2012: The New Swap File” is the reference.

What it contains

  • Memory pages of unloaded modern apps: working data, not documents.
  • A hidden system file at the root of the system volume. File Explorer only shows it when “Hide protected operating system files” is cleared.
  • Windows manages its size automatically.

Risks and best practices

  • The system keeps it locked and recreates it when needed, so deleting it by hand is pointless.
  • The Virtual memory dialog (System Properties > Advanced > Performance > Settings > Advanced) configures pagefile.sys. It has no setting specific to swapfile.sys.
  • Only turn virtual memory off if you understand the consequences: crashes, and no complete memory dump.
  • On a server or VDI, count this file together with pagefile.sys when sizing system disks.

Useful commands

Fenêtre de terminal
# Presence, size and attributes (read-only)
Get-Item C:\swapfile.sys -Force | Select-Object FullName, Length, Attributes, LastWriteTime
# Virtual memory configuration
Get-CimInstance Win32_PageFileUsage | Select-Object Name, AllocatedBaseSize, CurrentUsage

Report a mistake