Blog Archive

Monday 15 April 2013

Changing the sleep settings on a MacBook

This post is more of an aide-mémoire for me really, as all the information is easily found on the web. I recently bought a brand new MacBook Pro 13" and it's lovely apart from one problem. Or at least I thought it was a problem. Let me explain.

When you close the lid on the MacBook it quite naturally goes to sleep. When you open the lid, it wakes up, and it wakes up pretty quickly, just as you'd expect. However if you leave it for a while, 70 minutes as it turns out, it goes into a "deeper sleep" and writes RAM to disk and removes power to memory in order to conserve power. When you open the lid after this, it has to read the saved RAM back from disk into memory, and this causes a quite noticeable and annoying pause before the laptop wakes up fully so you can interact with it.

The solution turned out to be fairly simple: Altering the power saving settings from the command line (Terminal) using the pmset command. I did the following to extend the time before my MacBook goes into deep sleep to 24 hours.If the battery runs out or there is a power cut or something before then, so be it. I'll let the laptop boot from cold or whatever.

pmset -g # gets the current settings


pmset -a standbydelay 86400


And by the way, you need to set these settings when the power is plugged in to affect the power saving for AC power, or with the laptop running on batteries to change the power saving settings for battery power. At least I couldn't find a way of setting the AC settings when running off the battery.

Have a look at the man page for pmset.