0

I'm aiming to produce the following behavior on both battery and AC power:

  • Computer goes to sleep as usual upon closing lid or being idle for a few minutes.
  • Computer hibernates if left asleep for 5 minutes.

The reason for wanting it to hibernate is to increase security (and battery life when on battery). (For info on why this increases security see here.) But I don't want it to hibernate immediately, so that when I close the lid and walk to the next room I can wake it up without having to wait for the RAM contents to be loaded from disk.

I have succeeded in reliably producing this behavior when the laptop is on battery power, but when it's on AC power it just never hibernates. I'm doing this with the following settings in pmset:

  • setting hibernatemode to 3
  • setting standby to 1
  • setting standbydelay set to 300 (which is in seconds, so means 5 minutes)

This produces the behavior of the machine storing the sleepimage immediately but leaving the RAM powered; then after 300 seconds standby kicks in and causes the machine to turn off power to the RAM. Except this last part doesn't happen when the AC power is connected. So it seems like something is causing standby to operate differently when on AC power.

These two settings don't appear in the battery pmset profile and do appear in the AC profile:

womp                 0
networkoversleep     0

The only other differences are:

gpuswitch            0 (1 when on battery)  
disksleep            10 (5 when on battery) 

Here are the full pmset profiles for both:

Battery Power:
 lidwake              1
 autopoweroff         0
 autopoweroffdelay    0
 standbydelay         300
 standby              1
 ttyskeepawake        1
 hibernatemode        3
 darkwakes            0
 gpuswitch            1
 hibernatefile        /var/vm/sleepimage
 displaysleep         10
 sleep                15
 acwake               0
 halfdim              1
 lessbright           1
 disksleep            5
 SleepServices        0
AC Power:
 lidwake              1
 autopoweroff         0
 autopoweroffdelay    0
 standbydelay         300
 standby              1
 ttyskeepawake        1
 hibernatemode        3
 darkwakes            0
 gpuswitch            0
 hibernatefile        /var/vm/sleepimage
 womp                 0
 displaysleep         10
 networkoversleep     0
 sleep                15
 acwake               0
 halfdim              1
 disksleep            10
 SleepServices        0

I've tried to use autopoweroff and autopoweroffdelay, since that setting appears to be relevant when the machine is connected to power, but when I do that so far it seems to not cause anything other than normal sleep.

Many thanks!

MacBook Pro (Retina, 15-inch, Early 2013), OS X Yosemite (10.10.1)

0

Unfortunately, once the MBP is asleep... it can't wake-up to hibernate. Your best bet is to simply disable sleep on lid-close and enable a hibernate when idle for XXX time. When the lid is closed, power-consumption goes down quite significantly... (the backlight takes quite a bit of power by itself)

  • My experiments indicate that this is not true. With the settings above, it appears to go to sleep and then after five minutes hibernate when on battery power. However, if I could set it up as you are saying that would be fine. How would I do that? – Nevin Jun 18 '15 at 16:53
  • There is no stock way of doing this... however, there are programs out there like insomniax (macupdate.com/app/mac/22211/insomniax) that can disable the sleep on lid-close... and you can change the behavior of the idle-sleep to hibernate by doing this: sudo pmset -a hibernatemode 25 – TheCompWiz Jun 18 '15 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.