How to Delete Sleepimage File on Mac
What Is the Sleepimage File?
The sleepimage file is a hidden system file that macOS creates for hibernation. When your Mac goes to sleep, it saves the contents of RAM to disk as a backup. The sleepimage mac file is the same size as your installed RAM — so if you have 16 GB of RAM, the sleepimage is 16 GB. This single file can be a significant portion of your storage.
It's stored at `/private/var/vm/sleepimage` and is hidden by default.
Can You Safely Delete It?
Yes, you can delete the sleepimage file to free up disk space on mac. However, macOS will recreate it the next time your Mac goes to sleep unless you change the sleep mode. Deleting it provides only temporary relief unless you also adjust the hibernation setting.
To delete it, open Terminal and type `sudo rm /private/var/vm/sleepimage`. Enter your password when prompted.
Reclaim Mac finds and removes junk files automatically.
Change Sleep Mode to Prevent Recreation
To permanently prevent the sleepimage from being recreated, change your Mac's sleep mode. Open Terminal and type `sudo pmset -a hibernatemode 0`. This tells your Mac to use regular sleep only (keeping data in RAM) instead of hibernation (writing RAM to disk).
After changing the hibernate mode, delete the existing sleepimage file. It won't be recreated as long as the hibernate mode stays at 0.
Risks of Disabling Hibernation
With hibernation disabled, your Mac relies entirely on RAM during sleep. If the battery dies completely while sleeping, you'll lose any unsaved work. On desktop Macs plugged into power, this is rarely a concern. On MacBooks, it means losing data if the battery drains to zero.
Consider your usage pattern before making this change. If you always close apps before sleeping and save your work, the risk is minimal. This is a practical tradeoff to how to free up disk space on mac by the exact size of your RAM.
Restore Default Behavior
If you want to bring back the sleepimage, simply run `sudo pmset -a hibernatemode 3` in Terminal. macOS will recreate the sleepimage the next time your Mac sleeps. Mode 3 is the default for portable Macs, while mode 0 uses sleep only.
Clean your Mac in 60 seconds
Lifetime license. Offline. No subscription.