sleepimage – the Mac OS X sleepimage file explained
If you’ve used a tool like DaisyDisk to analyze your Mac’s disk space usage, you may have come across a file named ‘sleepimage’ that is rather large.
What is sleepimage in Mac OS X?
The ‘sleepimage’ file is just what it sounds like, it’s what your Mac had in it’s memory when the machine went to sleep, creating an image of your Mac’s previous memory state. When your Mac wakes from sleep, the content of sleepimage is read again and placed back into active memory, and your Mac is returned to the state that it was in prior to sleeping. Think of it like a swapfile of sorts, but for sleep and wake functionality only.
Why is sleepimage taking up so much space? 2GB, 4GB, 8GB, etc?
The sleepimage file is generally the exact same size as the amount of physical RAM your Mac has. If your Mac has 2GB of RAM, the sleepimage file will also be 2GB because there are 2GB of data that need to be stored when your Mac is put to sleep. You can check the size of your sleepimage file by typing the following command into the Terminal:
ls -lh /private/var/vm/sleepimage
You will then see data like:
-rw------T 1 root wheel 4.0G Oct 7 15:46 /private/var/vm/sleepimage
And the number between ‘wheel’ and the date is the sleepimage file size, in this case it is 4 GB.
There are cases where the sleepimage file is significantly larger than your physical RAM and this can be due to the file becoming corrupted.
Can I safely delete sleepimage from my Mac?
Yes, you can remove sleepimage and it will just be created again automatically the next time your Mac is put to sleep. To delete sleepimage, type the following command into the Terminal:
sudo rm /private/var/vm/sleepimage
You’ll be asked for the administrator password to gain access to remove the file, this is normal.
Where is sleepimage located?
If it wasn’t obvious from the previous commands, sleepimage is located alongside your Mac swapfiles at:
/private/var/vm/sleepimage
Hopefully that helps to explain sleepimage a bit and now you’ll understand what this mysteriously large file is on your Mac hard drive.

You failed to mention the difference between ‘sleep’ and ‘safe sleep’, and this might confuse some.
The sleepimage file is only needed for the safe-sleep function where your data is saved to the HDD before sleeping, if you want to permanently reclaim this disk space you can do so using the following commands in a terminal window.
This will revert your computer to the older sleep method, which will sleep faster and wake faster but does keep your data in memory during the sleep period.
to check which mode is active
pmset -g | grep hibernatemode
==============================
to change mode 0= old style sleep 3= new (save to disk style)
sudo pmset -a hibernatemode 0
==============================
to remove sleep disk image
cd /var/vm
sudo pmset -a hibernatemode 0
==============================
correction to the last part of my message…
to remove sleep disk image
rm /var/vm/sleepimage
copy&pasting only works right after the morning coffee
are there negatives to doing the old method (in where the new method was created)
is there a way to change where the sleep image is stored? I have two internal storage devices and want the sleep image off of my SSD and on my HDD.
I’m currently running the OS on a smaller SSD via express card slot and still have my bigger HDD in my Late 08 unibodyMBP and could use all the space I can get. The sleep image is currently 6GB reflecting the RAM as the article says.
Wow.Great..thank’s a lot..now i’m understand
I can think of a good thing with this method. Close your macbook pro and it will be put to sleep, and then take out the battery so it will shut off perm. Reattach the battery, and then reboot the mac, the mac will resume to where you left off because of the sleepimage in your hd. Its like… hibernation , but better.
Personally i perfer to disable it because i have a 5400rpm hd and 4 gigs of ram, and it takes like 10 seconds for the machine to fell asleep…
Just guessing, but looks like there is a setting “hebernatefile”:
pmset -a hibernatefile /path/to/sleepimage
[...] 1 next to it indicates that feature is enabled, a 0 is disabled. The ‘hibernatefile’ or sleepimage is where the contents of your Mac are kept when you sleep the machine, this serves as a cache file [...]
[...] I didn’t need this and I needed all the space I could get from my new drive. So I used this article to find and delete the [...]
From man pmset:
Please note that hibernatefile may only point to a file located on the root volume.
[...] fixing this by repairing permissions in the hope that some file responsible for sleep (such as my sleepimage file) had problematic permissions set. Alas, that didn’t work so I continued my search. I [...]
Can this cause any problems in the long run? If I close the lid will it just shut off?