By default, MacBooks are configured to back up the entire contents of RAM to disk before sleeping – this allows the state of a sleeping Mac to be restored, even if the battery has completely drained. OS X laptops are also configured to wake up automatically when the lid is open.
Entering this command into Terminal.app returns your OS X computer's current sleep mode, which by default is "3" for laptops:
pmset -g | grep hibernatemode
I changed my MacBook Pro from hibernatemode "3" to "0": sleep immediately and do not backup my 4GB worth of RAM to the hard drive. I also set my MacBook Pro not to wake on lid opening – no more accidental wake-ups in my backpack:
sudo pmset -a hibernatemode 0 sudo pmset -a lidwake 0Bonus: 4 more GB of disk space
Because my MacBookPro no longer writes its RAM to disk, I removed the sleepimage file, freeing up 4GB of hard drive space:
sudo rm /var/vm/sleepimageNow my MacBook Pro goes to sleep immediately on shutting the lid, and does not wake when I open the lid. Instead I just press any key.
SSD Drives
If your OS X laptop came with an SSD drive (e.g. MacBookAir), your Power Management settings are best left alone. If you have upgraded from a conventional hard drive to an SSD, refer to a discussion specifically on OS X SSD optimization, such as Fredrik Poller's below.
References:
- Two Seconds to Sleep, Tip of the Week, apple.com/pro/tips
- Alternative to using terminal.app: SmartSleep.prefpane, www.jinx.de
- pmset(1) Mac OS X Manual Page, developer.apple.com
- Discover Safe Sleep's secrets, Rob Griffiths, Macworld.com, 19-Oct-2006
- Set newer portable Macs' sleep mode, Rob Griffiths, Macworld.com, 19-Oct-2006
- Optimizing Mac OS X for SSD Drives, Fredrik Poller, poller.se, 27-Aug-2010