Matthew Ahrenstein bio photo

Matthew Ahrenstein

Enterprise Infrastructure Lead for an amazing company, hiker, avid shooter, and inventor.

Google+ Twitter YouTube LinkedIn Github GPG Key

So if you own one of those fancy new MacBook Pro with Retina Display laptops, you might have witnessed this irritating bug. If you close the lid sometimes when you wake the computer up, the UI is frozen for 8-10 seconds. Here is how to fix that.

So OS X 10.8 (Mountain Lion) introduced a new deeper sleep mode, that flushes your RAM to disk after a time limit has been crossed. It allows RAM to be powered down to save battery life. Now even with the SSD, restoring 8GB or 16GB of RAM takes a few seconds. During this time you can see the UI, but the mouse and keyboard are not functional, and the time you closed the lid is displayed in the top corner. Once the time is updated you’ll notice you regain control. That’s because the RAM restoration is complete.

This feature is set to 1 hour by default, so if you move from Conference Room A to Conference Room B at your job, you won’t notice, but leave your laptop in your bag while driving, and it may be frozen when you arrive at your destination.

Fortunately this setting is adjustable. Just open Terminal and enter the following command:

sudo pmset -a standbydelay 86400



This command changes the timeout to enter deep sleep mode from 1 hour to 24 hours. This isn’t a complete fix, but it does give you a decent amount of time to use your laptop again before the timer triggers deep sleep. You can of course set it longer if you’d like.

You can also disable deep sleep mode, and set your Mac to use the old style sleep method only with this command:

sudo pmset -a hibernatemode 0