The hibernation file is the hidden system file hiberfil.sys in the root of the Windows system volume that stores a compressed image of physical memory when the computer enters hibernation, so the machine can power off completely and later resume the exact session that was running. In Windows storage and file systems, it is one of the large reserved files that the operating system manages on its own, alongside the page file, and it also underpins the Fast Startup feature.
How the hibernation file preserves a session
When hibernation starts, Windows writes the contents of RAM to hiberfil.sys and then cuts power, a state defined by ACPI as S4. The kernel first pauses drivers and services, then the hibernation engine compresses the in-use memory pages and writes them sequentially to disk. Free and easily reconstructed pages are skipped, which keeps the saved image much smaller than total installed memory.
On the next power-on, the Windows Boot Manager detects a valid hibernation image and launches the resume loader, winresume.efi on UEFI systems, instead of a normal boot. The loader reads the image back into memory, restores processor state and returns control to the kernel, which reinitializes devices and reopens the user session with applications and documents where they were left.
Because the image describes a running kernel, the file is only valid for the exact boot configuration that produced it. If the disk is modified from another operating system in the meantime, resuming could corrupt data, which is why Windows marks hibernated NTFS volumes as in use and unsafe to mount read-write elsewhere.
The table below summarizes the main stages of a hibernation cycle and the component responsible for each.
| Stage | Component | What happens |
|---|---|---|
| Prepare | Power manager and drivers | Devices receive a power IRP and save their state |
| Write image | Hibernation engine | Compressed memory pages are written to hiberfil.sys |
| Power off | ACPI firmware | System enters S4 and draws almost no power |
| Resume | Boot manager and winresume | Image is read back and processor state restored |
| Invalidate | Kernel | Image header is cleared so it cannot be reused |
Size, types and configuration of hiberfil.sys
Windows sizes the hibernation file as a percentage of installed RAM, not as a fixed amount. Since Windows 10 there are two file types: a full file that supports both hibernation and Fast Startup, and a reduced file that supports only Fast Startup. The default full size is about 40 percent of physical memory, which relies on compression to fit typical workloads.
Administrators control the file with the `powercfg` command from an elevated prompt. The following table lists the most useful settings and their effect on the file.
| Command | Effect | Typical use |
|---|---|---|
powercfg /hibernate off | Deletes hiberfil.sys and disables hibernation and Fast Startup | Reclaiming space on small SSDs |
powercfg /hibernate on | Recreates the file and enables hibernation | Restoring default behavior |
powercfg /h /type reduced | Shrinks the file to about 20 percent of RAM | Keeping Fast Startup without full hibernation |
powercfg /h /type full | Sets the full file type | Laptops that need real hibernation |
powercfg /h /size 50 | Sets the full file to 50 percent of RAM | Memory-heavy sessions that fail to hibernate |
The size setting accepts values from 40 to 100 percent. Raising it helps when hibernation fails because the compressed image does not fit, a symptom that appears with large virtual machines or databases held in memory. Lowering the type to reduced is the safest space saver on desktops that never hibernate.
The file lives only on the system drive, usually C:, and cannot be moved to another volume. It is protected as a hidden system file and is excluded from Volume Shadow Copy snapshots and from most backup sets, because restoring an old memory image would be meaningless.
Hibernation file compared with related storage files
The hibernation file is often confused with the page file and the swap file, since all three are large hidden files in the root of the system drive. Their purposes differ: the page file extends virtual memory while Windows runs, whereas hiberfil.sys is written only at shutdown or hibernation and read once at the next start.
| File | Purpose | Active when | Can be relocated |
|---|---|---|---|
| hiberfil.sys | Stores memory image for hibernation and Fast Startup | Shutdown, hibernation and resume | No |
| pagefile.sys | Backs virtual memory and holds crash dumps | Continuously while running | Yes |
| swapfile.sys | Swaps suspended packaged apps | While running | Follows the page file |
| MEMORY.DMP | Records memory after a system crash | After a bug check | Yes, through dump settings |
Sleep, hibernation and hybrid sleep also differ in how they use the file. Plain sleep keeps memory powered and does not touch hiberfil.sys, while hybrid sleep writes the image as a safety copy but keeps RAM powered, so a power loss still lets the session resume from disk.
| Power state | Memory powered | Uses hiberfil.sys | Resume time |
|---|---|---|---|
| Sleep (S3 or Modern Standby) | Yes | No | About 1 to 3 seconds |
| Hibernate (S4) | No | Full image | Typically 5 to 20 seconds |
| Hybrid sleep | Yes | Full image as backup | Like sleep unless power fails |
| Fast Startup shutdown | No | Kernel session only | Faster than a cold boot |
Fast Startup and its dependence on hibernation
Fast Startup is a hybrid shutdown that logs off users and then hibernates only the kernel session, the memory of session 0 with drivers and system services. Because the saved image is small, the next boot skips much of the device enumeration and service start, which shortens startup time on systems with slower storage.
The trade-off is that a Fast Startup shutdown is not a true cold boot. Driver state persists, the system volume stays in a hibernated state, and some updates or hardware changes take effect only after a Restart, which always performs a full boot. Turning off hibernation entirely also disables Fast Startup as a side effect.
Risks, limitations and troubleshooting
The most important limitation is disk space: on a machine with 32 GB of RAM, a full file can occupy around 13 GB of the system drive. A second concern is data confidentiality, because the image contains whatever was in memory, including keys and documents. With BitLocker enabled the file is encrypted along with the rest of the volume, so the risk applies mainly to unencrypted drives.
Typical symptoms and their causes are summarized below.
| Symptom | Likely cause | Fix |
|---|---|---|
| Hibernate option missing | File disabled or reduced type | Run powercfg with hibernate on and full type |
| Hibernation fails with memory in use | Compressed image too large | Increase size with the powercfg size option |
| Linux mounts NTFS read-only | Volume left hibernated by Fast Startup | Shut down with Fast Startup off |
| Updates seem not to apply | Shutdown preserved kernel state | Use Restart instead of Shut down |
| Large unexplained space on C: | Full hiberfil.sys present | Switch to reduced type or disable |
A common mistake is deleting hiberfil.sys manually in Explorer or with Disk Cleanup expectations. The file is locked while Windows runs, and the only supported removal path is `powercfg /hibernate off`, which also updates the boot configuration consistently.
Put simply
The hibernation file is a snapshot of everything your PC is doing, saved to the disk. The computer can then switch off completely. When you turn it back on, Windows loads that snapshot. Your open programs and documents are exactly where you left them.
Think of it as putting a bookmark in a book and closing it. The catch is that the bookmark takes up room. The file can use several gigabytes of drive space. You can shrink or remove it if you never use hibernation.
In practice
A field engineer uses a Windows laptop with 16 GB of RAM and a 256 GB SSD. During a two-day site visit she keeps a virtual machine, a diagnostic tool and several reports open, and she cannot charge the laptop overnight. Sleep would drain the battery, so she chooses Hibernate, and Windows writes roughly 6 GB of compressed memory to hiberfil.sys before powering off.
The next morning the laptop resumes in about 12 seconds with every window intact. Later, when the SSD runs short of space, the IT team considers disabling hibernation but instead keeps the full file type, because reliable multi-day hibernation matters more to her work than 6 GB of storage. On office desktops that never hibernate, the same team applies `powercfg /h /type reduced`, keeping Fast Startup while recovering several gigabytes per machine.