Two hidden system files in the root of C:\ quietly consume gigabytes: pagefile.sys (virtual memory) and hiberfil.sys (the hibernation image). They serve different jobs, so the safe answer differs. The page file should usually be left to Windows; the hibernation file is the one you can remove if you don't use hibernate or fast startup:
powercfg /h off
Run that in an elevated Command Prompt and hiberfil.sys disappears, reclaiming several GB.
TL;DR
pagefile.sysis virtual memory: an overflow area for RAM. Keep it managed by Windows.hiberfil.sysstores your full RAM contents so the PC can hibernate; it's roughly 40% of installed RAM.- Safest single win:
powercfg /h offremoveshiberfil.sysentirely (disables hibernate and fast startup). - Don't disable the page file outright; it can cause crashes and breaks crash-dump capture.
- Both files sit at
C:\, are hidden, and shouldn't be deleted in File Explorer.
What is pagefile.sys and should I touch it?
pagefile.sys is the Windows page file, a chunk of disk used as overflow when physical RAM fills up. Windows sizes it automatically (System managed), often 1-8 GB depending on RAM and workload.
Leave it alone in most cases. If you must change it, do it through the GUI, not by deleting the file: open sysdm.cpl, go to Advanced > Performance > Settings > Advanced > Virtual memory > Change, and set a custom size or let the system manage it. Disabling it entirely is risky: low-RAM machines can crash, some apps demand a page file, and you lose the ability to capture a crash dump.
What is hiberfil.sys and can I remove it?
hiberfil.sys holds a snapshot of everything in RAM so Windows can power off completely during hibernate and restore your session instantly. It also backs fast startup. Its size is typically about 40% of your installed RAM, so 16 GB of RAM means roughly a 6 GB file.
If you never hibernate and don't rely on fast startup, remove it:
powercfg /h off
To bring it back later:
powercfg /h on
You can also shrink it instead of deleting it, keeping hibernate available at a reduced size:
powercfg /h /size 50
What Windows does natively, and where it stops
Windows manages both files for you. The page file is auto-sized and grows or shrinks with demand, and the hibernation file is created and maintained whenever hibernate or fast startup is enabled. You rarely need to intervene.
Where it stops: Windows will not delete the hibernation file just because your disk is low, and it won't ask before reserving 40% of your RAM in disk space. There's no setting in Storage Sense for either file. To reclaim that space you must run powercfg /h off yourself, and to cap the page file you must open the virtual-memory dialog manually.
What this cannot do, and what to leave alone
Don't try to delete pagefile.sys or hiberfil.sys from File Explorer; they're protected system files and Windows will recreate or refuse them. Always use the proper tools (sysdm.cpl for the page file, powercfg for hibernation).
Know the trade-offs. Turning off the page file can destabilize a low-RAM PC and disables memory dumps, so don't do it just to save a gigabyte. Running powercfg /h off also turns off fast startup, which is why some laptops boot a little slower afterward, and you lose hibernate as a low-power sleep option. These files aren't bloat or leftovers; they're working storage, so only change them deliberately.
Want the bigger space hogs? See how to find the largest files on Windows 11 without third-party apps, and to understand another big system folder, read what is the AppData folder and can I delete it.
FAQ
Is it safe to disable the page file to save space?
Generally no. On low-RAM systems disabling pagefile.sys can cause app failures or crashes, and it stops Windows from writing crash dumps. If space is tight, set a smaller custom size via sysdm.cpl instead of turning it off.
How much space does powercfg /h off free?
Roughly the size of hiberfil.sys, which is about 40% of your installed RAM. On a 16 GB machine that's around 6 GB. The exact figure depends on your hibernation file type setting.
Will turning off hibernation slow my PC?
It can affect boot slightly because powercfg /h off also disables fast startup. Cold boots may take a few seconds longer, and you lose hibernate entirely. Sleep (standby) still works normally.
If the device that's really out of space is in your pocket, Cleanor for iPhone clears photo and file clutter in a couple of taps.