No Image

Sleep Image in Mac OS X

June 29, 2015 No Comments

If you have used any third party tools to analyze your Mac’s drive space usage, you may have come across a files name as ‘sleep image’ that is usually of larger in size.

Overview of sleep image in Mac OS X:

“sleep image” file is just what it sounds like, it’s the file what your OS X stored in it’s memory when the machine went to sleep, and creating an image of your Mac’s previous memory state. When your Mac wakes from sleep mode, the content of sleep image is read again and placed back into active memory of Macintosh, and your Mac is returned to the state that it was in prior to sleep mode.

Why is sleep image taking up so much space in your Os X? 2GB, 4GB, 8GB, etc?

The sleepimage file is generally the exact same size as the amount of physical RAM your Mac is having. If your Mac OS X 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.

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

Can I safely delete sleepimage from my Mac?

Yes, you can remove sleep image and it will just be created again automatically the next time your Mac is put to sleep. To delete sleep image, type the following command into the Terminal: sudo rm/private/ver/vm/sleepimage. You’ll be asked for the administrator password to gain access to remove the file from your Mac system.

Hopefully now you understood what this mysterious large files “sleep image” on your Mac machine. Stay Tunes on this Blog to know more facts about Macintosh.