The sleepimage File on Mac: Why It's So Big
Poke around /private/var/vm and you'll find a file called sleepimage that can be as large as your Mac's entire RAM — 16 GB of memory often means a 16 GB file sitting on disk. It isn't junk, and deleting it doesn't stick. Here's what it's for, and the supported way to control it.
What the sleepimage file does
When your Mac goes to sleep, macOS normally keeps the contents of RAM alive with a trickle of power. Safe sleep adds a second layer of protection: the system writes a full copy of everything in memory to /private/var/vm/sleepimage. If the battery dies completely while the Mac is asleep, macOS restores your open apps, windows, and unsaved documents from that file instead of losing them.
That's why the file exists on every Mac laptop by default, and why it's roughly the size of your installed RAM — it has to be able to hold everything memory might contain. This behavior is the same on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.
Check how big yours is
# show the sleepimage file and its size
ls -lh /private/var/vm/sleepimage
On a 16 GB machine, expect anything up to about 16 GB. The space it uses is counted under System Data in the storage view, which is one reason that category can look so bloated. On desktop Macs the file is often absent or tiny, because desktops don't write it by default.
Why deleting it doesn't work for long
You can remove the file with sudo rm and you'll get the space back — until the next time the Mac sleeps, when macOS quietly recreates it at full size. Fighting the file directly is pointless. The supported control is the hibernation mode setting, which decides whether the file gets written at all.
Control it with pmset hibernatemode
First, check what your Mac is currently set to, and note the number so you can restore it later:
# show the current hibernation mode
pmset -g | grep hibernatemode
0— sleep only. RAM stays powered and no sleepimage is written. The default on desktop Macs.3— safe sleep. RAM stays powered and a copy is written to disk. The default on Mac laptops.25— full hibernation. RAM powers off entirely and the Mac restores from disk on wake. Slowest to wake, gentlest on the battery — but it still needs the sleepimage file, so it saves no space.
To stop the file from being created on a laptop:
# stop writing sleepimage
sudo pmset -a hibernatemode 0
# remove the existing file once — it won't come back in mode 0
sudo rm /private/var/vm/sleepimage
# undo: restore the laptop default
sudo pmset -a hibernatemode 3
The trade-off is real. With hibernatemode 0, if your MacBook's battery runs completely flat while it's asleep, unsaved work is gone — there's no disk copy to restore from. On a machine with a healthy battery that gets used daily, that risk is small, but it isn't zero. If you're only chasing a few gigabytes, emptying the Trash or clearing old installers is a safer win than giving up safe sleep.
Two related knobs worth knowing about while you're in pmset: standby moves a sleeping laptop into full hibernation after a delay to save battery, and it relies on the same sleepimage file — so if you disable the file with mode 0, standby has nothing to restore from. And whatever you change, pmset -g with no arguments prints every current power setting in one screen, which makes it easy to write down the state you're changing before you change it.
Terminal power tweaks like this are easy to set and easy to forget. Mainspring turns 90+ hidden macOS settings into labelled toggles that remember the default — so you can flip any change back in one click.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
One more power lever
hibernatemode is one of dozens of switches inside pmset, the same tool that controls sleep timers, Power Nap, and wake-on-network behavior. For the full tour, see our practical guide to pmset.