12

I'm having a problem with my MacBook Pro (mid 2012) where by when I lock my machine and then return several hours later (at least six hours) it will not respond to me pressing the keyboard.

I have to press the power button and then it boots up requiring a password. Once this password has been entered it takes a few minutes to slowly start all of my processes again (I hear skype logging in behind the blue screen) eventually my bluetooth mouse and keyboard are connected. Finally I can then enter my password to actually gain access to my machine.

This is a problem I've had with OSX since Mavericks was released.

Below is a screenshot of the settings I have tried to change (everything possible) to stop this stupid behaviour and it still persists!

Settings - Screenshot Settings - Screenshot Settings - Screenshot

2 Answers 2

27

From a Terminal, use the following command to disable hibernation:

sudo pmset -a hibernatemode 0

If you later want to enable hibernation, use:

sudo pmset -a hibernatemode 3

If you want to free up the disk space used by hibernation, use the following command:

sudo rm /var/vm/sleepimage
  • Note: This file is automatically recreated as needed if hibernation is reenabled and it doesn't already exist.
8
  • I get "operation not permitted" deleting the sleep image. Dec 1, 2017 at 3:26
  • 1
    @AbhiBeckert - preface it with "sudo" as in the command given in the answer above.
    – Michael H.
    Dec 3, 2017 at 19:21
  • @khedron I did. I also tried -f with no luck. Since the answer is a couple years old I'm guessing it's simply out of date. Fortunately my sleep image was small, 400MB despite me having 16GB RAM. Dec 8, 2017 at 1:19
  • @Abhi Beckert, What version of macOS are you running? Dec 8, 2017 at 1:38
  • 1
    I also had to restart the Mac for the changes to take effect. pmset showed that it was disabled, but it was only actually disabled after I restarted the Mac. Mar 8, 2020 at 16:37
2

Updated answer for Mojave and Catalina. You can prevent hibernation mode via this command:

sudo pmset -a standby 0

Source: https://www.howtogeek.com/260478/how-to-choose-when-your-mac-hibernates-or-enters-standby/

You can disable standby mode entirely, if you like. This isn’t necessarily a good idea, as it means a portable MacBook will gradually drain its battery rather than entering a very lower power mode standby mode when you leave it in sleep mode. But it’s your choice.

1
  • 1
    The accepted answer also works for Mojave and Catalina. Setting hibernatemode to 0 disables hibernation completely; period. Your answer only prevents that a system that has written a hibernate file, yet is still in sleeping state would progress to hibernate state after some time. Yet if hibernate is disabled completely, the system cannot go into hibernate state, no matter how standby is configured.
    – Mecki
    Jan 7, 2021 at 22:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .