pagefile.sys, hiberfil.sys, and swapfile.sys are hidden system files that can quietly consume several gigabytes of disk space, occasionally more than 16 GB on machines with a lot of RAM. Windows creates and manages them automatically, but knowing what each one does helps you decide whether shrinking or removing it is worth the trade-off.
What Each File Does
pagefile.sys, the paging file
When Windows runs low on physical RAM, it moves data that hasn’t been used recently to disk. That data goes into pagefile.sys. The file also stores crash dump information, so removing it can make it harder for Windows to generate useful error reports after a crash.
Windows manages the paging file size automatically by default, and for most systems that’s the right call. The main reason to touch it is if you want to move it to a second internal drive or reclaim space on a cramped SSD. You can learn more about the page file and its purpose.
hiberfil.sys, the hibernation file
hiberfil.sys stores a snapshot of your system’s memory when you hibernate. It’s also what makes Fast Startup work, the feature that lets Windows 10/11 boot quickly by saving kernel data during shutdown instead of doing a full restart.
When hibernation is enabled, hiberfil.sys takes up roughly 75% of your installed RAM. On a 32 GB system, that’s around 24 GB sitting on your drive at all times. If you never hibernate, disabling it is the fastest way to reclaim that space. You can enable or disable hibernation as needed.
swapfile.sys, the swap file
swapfile.sys is a companion file to pagefile.sys that Windows keeps on most systems by default. It handles certain paging operations more efficiently than the main paging file, particularly suspending and resuming app states. You’ll typically see it sitting at around 16 MB, though it can grow depending on workload.
You can’t manage swapfile.sys on its own. It’s tied to pagefile.sys: disable the paging file and swapfile.sys disappears with it.
How These Files Affect Your Disk Space
| File | Typical size | When it exists |
|---|---|---|
| pagefile.sys | Variable (system-managed) | When the paging file is enabled |
| hiberfil.sys | ~75% of your RAM | When hibernation is on |
| swapfile.sys | ~16 MB (variable) | When pagefile.sys exists |
With 16 GB of RAM and Fast Startup on, hiberfil.sys alone can take up roughly 12 GB. That’s a meaningful chunk of a 256 GB SSD. You can learn more about managing the page file to optimize your disk space.
How to Manage or Remove These Files
Don’t try to delete these files in File Explorer. Windows locks them while it’s running, and even if you could delete one, it recreates it on the next reboot. Change the settings that control them instead.
Disable hibernation to remove hiberfil.sys
Turning off hibernation removes hiberfil.sys completely. You’ll lose the ability to hibernate and Fast Startup gets disabled too, but your system shuts down and boots normally without them. For most desktop users, it’s a clean trade.
- Open Start, search for Command Prompt, right-click it, and select Run as administrator.
- Run the following command:
powercfg /hibernate off
- Restart Windows. hiberfil.sys should be gone when your machine comes back up.

To re-enable hibernation later, run powercfg /hibernate on from the same elevated prompt.
Change or move pagefile.sys
- Press
Windows + R, typesysdm.cpl, and press Enter.

- Click the Advanced tab.
- Under Performance, click Settings.
- In the Performance Options window, click the Advanced tab.
- Under Virtual memory, click Change.

- Uncheck Automatically manage paging file size for all drives.
- Select the drive you want to change. Choose System managed size to let Windows handle it, or No paging file to disable it for that drive.
- Click Set, then OK, and restart when prompted.

Note: Disabling the paging file entirely can cause instability on systems with limited RAM and reduces Windows’ ability to capture crash dumps. Leave it enabled unless you have a specific reason, and ideally a second internal drive to move it to. You can also consider disabling Fast Startup if you don’t need it.
Find these files in File Explorer
Windows hides them by default. To see them:
- Open File Explorer and click the ellipsis (…) in the toolbar.
- Select Options, then click the View tab.
- Uncheck Hide protected operating system files (Recommended) and click OK.

You’ll find pagefile.sys, hiberfil.sys, and swapfile.sys in the root of your C: drive. Inspect them to confirm their sizes, but use the settings above to remove them, not File Explorer.
Conclusion
hiberfil.sys is the easiest target for most people. If you don’t use hibernation, powercfg /hibernate off removes it with no real downside. Leave pagefile.sys to system management unless you have a second internal drive and a specific reason to move it; the automatic sizing works well on modern hardware. swapfile.sys takes care of itself either way.
