How to Analyze pagefile.sys and swapfile.sys in Windows 11
This article provides a straightforward guide on finding, analyzing,
and managing large hidden system files—specifically
pagefile.sys and swapfile.sys—in Windows 11.
You will learn what these files do, how to make them visible in File
Explorer, how to use built-in and third-party tools to inspect their
disk footprint, and how to safely adjust or move them if they consume
too much storage.
What Are pagefile.sys and swapfile.sys?
pagefile.sys(Page File): Windows uses this file as secondary virtual memory. When physical RAM fills up or programs remain idle, Windows offloads memory pages topagefile.syson your drive.swapfile.sys(Swap File): Introduced for Universal Windows Platform (UWP) apps, this file acts like a specialized paging file optimized for suspending and resuming modern Windows apps without cluttering the primary pagefile.
Both files are located at the root of your system drive (usually
C:\) and are locked by the operating system while
running.
Step 1: Make Hidden System Files Visible
By default, Windows 11 conceals protected operating system files.
- Open File Explorer.
- Click the three dots (…) on the top menu and select Options.
- Go to the View tab.
- Select Show hidden files, folders, and drives.
- Uncheck Hide protected operating system files (Recommended).
- Click Yes on the warning prompt, then click Apply and OK.
You can now view pagefile.sys and
swapfile.sys in the root of C:\.
Step 2: Analyze File Size and Storage Impact
Because these files are actively locked by Windows, standard file readers cannot open them directly. Use these methods to analyze their space and resource usage:
Method A: Windows Storage Settings
- Open Settings (
Win + I) and navigate to System > Storage. - Click on System & reserved.
- Review the Virtual memory entry, which displays the
combined active size of
pagefile.sysandswapfile.sys.
Method B: Disk Analysis Tools (Admin Mode)
Standard disk tools may fail to scan locked system files unless
elevated: * WizTree or TreeSize Free:
Run these tools as Administrator to inspect the exact allocation,
cluster size, and drive percentage taken up by pagefile.sys
and swapfile.sys instantly via the NTFS Master File Table
(MFT).
Method C: Memory Allocation with Sysinternals RAMMap
To see how much memory Windows actually offloads to these files: 1.
Download and run RAMMap (from Microsoft Sysinternals)
as Administrator. 2. Select the File Summary tab. 3.
Sort by size or path to see how much active data is mapped directly into
pagefile.sys.
Step 3: Manage and Resize pagefile.sys
If pagefile.sys grows excessively large, you can
configure its size or move it to a secondary drive:
- Press
Win + R, typesysdm.cpl, and press Enter to open System Properties. - Select the Advanced tab.
- Under Performance, click Settings.
- In the Performance Options window, go to the Advanced tab and click Change… under Virtual memory.
- Uncheck Automatically manage paging file size for all drives.
- Select your drive (usually
C:):- To set a static size: Select Custom
size, enter identical values for Initial size (MB) and
Maximum size (MB) (e.g.,
4096to8192MB depending on your RAM), and click Set. - To move it: Select
C:, choose No paging file, click Set, then select a secondary drive (e.g.,D:), choose System managed size, and click Set.
- To set a static size: Select Custom
size, enter identical values for Initial size (MB) and
Maximum size (MB) (e.g.,
- Click OK and restart your PC to apply the changes.
Note: Disabling pagefile.sys entirely is not
recommended, as some programs and Windows crash dumps require
it.