How to Stop macOS from Automatically Creating a Sleep Image

The Silent Space Hog

When you close the lid of your MacBook, macOS does not just put the RAM into a low-power state (standard sleep); by default, it also creates a “Sleep Image.” This is a massive hidden file written directly to your internal SSD that contains the exact contents of your RAM. This hibernate feature ensures that if your battery completely dies while the laptop is asleep, you will not lose your unsaved work when you plug it back in. However, if you have a MacBook with 32GB or 64GB of RAM and a relatively small 512GB SSD, this constantly updating `sleepimage` file permanently consumes a massive chunk of your usable disk space.

Disabling Safe Sleep

To reclaim gigabytes of storage space and stop macOS from automatically creating and updating the large hibernate sleep image, you must use the terminal to alter the system’s power management configuration.

Open the Terminal application (found in Applications > Utilities). You will use the `pmset` (power management settings) command. First, check your current status by typing pmset -g | grep hibernatemode. If it returns `hibernatemode 3` (the default for MacBooks), your system is creating sleep images. To disable this, type sudo pmset -a hibernatemode 0 and press Enter (you will need to input your administrator password). Mode `0` means the RAM stays powered during sleep, but nothing is written to the disk. Finally, to actually reclaim the space, you must delete the existing file. Type sudo rm /private/var/vm/sleepimage and press Enter. Be aware: by doing this, if your MacBook battery dies completely while asleep, you will lose unsaved work.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.