6

My all new MacBook Pro was on the battery, and warned me that the battery was almost finished. I left the Mac take care of himself. Later, I plugged the Mac and I pressed the button Power. Hearing the startup sound made me frosty. The Mac had shut down !

When my venerable old MacBook Pro runs out of battery, he goes safely into hibernation, and, when later I plug him and press the button Power, I have the white bars advancing on the screen and everything I had comes back to life ! This is very nice. How to have my new MacBook Pro do the same when he runs out of juice ?

On my new MacBook Pro, I have Mavericks.

Nicolas Barbulesco
  • 2,322
  • 7
  • 33
  • 45

1 Answers1

2

Newer versions of OS X support restoring state when you log in. This means that any applications that were open when you lost power, shut down the machine or rebooted would open back up to where they were previously.

Using this mechanism, there is no need to write the 'hibernation state' to the disk, which (a) uses a big lump of hard disk space, (b) takes time and (c) is risky - if there's not enough power to complete writing the data, you lose all of the state.

You can use the following Terminal command to configure this if you prefer:

sudo pmset hibernatemode 25

per the help at man pmset:

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.

...but please heed the following warning in the help (man pmset):

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.

JBRWilkinson
  • 1,815
  • 2
  • 16
  • 17
  • 1
    Thank you for your answer. You mean that shutting down is now the default behaviour, and that all new portable Macs with Mavericks have that problem ?? Restoring the whole state **without reboot** was a much nicer user experience. About your *(c) risky* argument : the risk is just that saving can fail. It is not worse than never saving at all. The behaviour I encounter on my new Mac is really annoying, it is a regression. For example, in 2014 Safari still does not restore form data, so now I have lost a Wikipedia edit. – Nicolas Barbulesco Mar 08 '14 at 01:59
  • According to `man pmset`, I don't need to set `hibernatemode` to `25`. I dont want this. – Nicolas Barbulesco Mar 08 '14 at 14:37
  • According to `man pmset`, what I want — and what I am supposed to have — is `hibernatemode` set to `3`. – Nicolas Barbulesco Mar 08 '14 at 14:39
  • I cite `man pmset` : “**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.” – Nicolas Barbulesco Mar 08 '14 at 14:41
  • 1
    On my venerable old MacBook Pro, `pmset -g` gives me `hibernatemode = 3`. On my new Mac too. The difference is that on my new Mac this does not work. – Nicolas Barbulesco Mar 08 '14 at 14:46
  • If the setting on your brand-new laptop is the same as the old one and it behaves differently, I propose you call/visit Apple for support. There are multiple reasons this could happen. – JBRWilkinson Apr 26 '14 at 18:24
  • 4
    "Using this mechanism, there is no need to write the 'hibernation state' to the disk…" is total nonsense. What if I'm working in a web form when my battery dies? With hibernation, the contents of the form are preserved. Without it, the browser restarts and it's gone forever. – Seanonymous Aug 04 '14 at 18:01