How to disable sleepsafe hibernate mode on your mac

How to disable sleepsafe hibernate mode on your mac. Your mac has a few cool features to let it wake form hibernation quickly.
one is called sleepsafe.
sleepsafe works by creating a file in your harddrive that contains all of the contents of your ram inside it so that it can be applied to your system once it wakes from sleep.

the problem with this is that it takes up lots of space on your drive.

apple has introduced Autosave and Resume, which will automatically save the content of all your documents and will automatically open them again after you restart your computer.

these two new features make the need for sleepsafe not so important any more.
by disabling sleepsafe you can effectively recover harddrive space (in my case I can get an extra 8gb!)

to turn off sleepsafe mode, open terminal and type:

sudo pmset hibernatemode 0

you have now disabled sleepsafe mode, but the file that holds the content of your ram still exists, you can now remove it:

sudo rm /var/vm/sleepimage

to re-enable sleepsafe mode, open terminal and type:

sudo pmset hibernatemode 3

the man page for pm set has the following recommendations:

We do not recommend modifying hibernation settings. Any changes you make are not supported. If you choose to do so anyway, we recommend using one of these three settings. For your sake and mine, please don't use anything other 0, 3, or 25.

hibernatemode = 0 (binary 0000) by default on supported desktops. The system will not back memory up to persistent storage. The system must wake from the contents of memory; the system will lose context on power loss. This is, historically, plain old sleep.

hibernatemode = 3 (binary 0011) by default on supported portables. The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from disk image.

hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life, you should use this setting.

Tags for How to disable sleepsafe hibernate mode on your mac

Apple Battery Default Disk File Image Life Mac Open Power Save Settings Store Terminal