Mac: Safe Sleep

Filed in mac Leave a comment

recently while scanning my harddisk with this awesome tool, OmniDiskSweeper from the Omni Group, i realise i have a 4GB file in “/var/vm” with the filename “sleepimage”, initially thinking it was a sleep image created by VMWare, which i use to run windows to debug ie, i deleted it, but it jus keep coming back! googling didn’t help much in figuring out what this file do and who created it until today!

that when i learnt about this hidden function of mac call Safe Sleep from MacWorld, is one very old article, but is very relevant, you can go over to macworld to read more, i am just going to record a few important points here.

to check current setting: (in terminal)

pmset -g | grep hibernatemode

the output will be something like:

hibernatemode 3

the 3 here indicates the mode, other mode incldues,
0 – Old style sleep mode, with RAM powered on while sleeping, safe sleep disabled, and super-fast wake.
1 – Hibernation mode, with RAM contents written to disk, system totally shut down while “sleeping,” and slower wake up, due to reading the contents of RAM off the hard drive.
3 – The default mode on machines introduced since about fall 2005. RAM is powered on while sleeping, but RAM contents are also written to disk before sleeping. In the event of total power loss, the system enters hibernation mode automatically.
5 – This is the same as mode 1, but it’s for those using secure virtual memory (in System Preferences -> Security).
7 – This is the same as mode 3, but it’s for those using secure virtual memory.

my mac current mode is 3, and really i don’t really need safe sleep, so m gng to jus switch mine to 0.
in terminal again, type:

sudo pmset -a hibernatemode 0

alright, now in terminal again,

sudo rm /var/vm/sleepimage

4gb of hdd space recovered! imaging the new mac with 8gb of ram! gosh, that will be 8gb of hdd saved man!
but ok, if you ever lost power while in sleep mode, you lost everything! depends on how you weigh the importance.

Set newer portable Mac’s sleep mode
How to Quickly Sleep Your MacBook

, , , ,