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?

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.

  1. Open File Explorer.
  2. Click the three dots (…) on the top menu and select Options.
  3. Go to the View tab.
  4. Select Show hidden files, folders, and drives.
  5. Uncheck Hide protected operating system files (Recommended).
  6. 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

  1. Open Settings (Win + I) and navigate to System > Storage.
  2. Click on System & reserved.
  3. Review the Virtual memory entry, which displays the combined active size of pagefile.sys and swapfile.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:

  1. Press Win + R, type sysdm.cpl, and press Enter to open System Properties.
  2. Select the Advanced tab.
  3. Under Performance, click Settings.
  4. In the Performance Options window, go to the Advanced tab and click Change… under Virtual memory.
  5. Uncheck Automatically manage paging file size for all drives.
  6. 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., 4096 to 8192 MB 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.
  7. 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.