4

Does macOS have hibernation mode which works exactly like hibernation in Windows (RAM is saved to the disk and power is switched off)?

When I use hibernation in macOS, computer still consumes energy. Is it possible to set it somehow, so that power is switched off after hibernation?

  • 1
    Windows machines still use power - test it by removing the battery. – Solar Mike Aug 28 '21 at 16:43
  • 1
    Shut it down instead - it will come back up exactly as you left it for 99% of apps [very very much unlike Windows] & take no more than 30 seconds. – Tetsujin Aug 28 '21 at 18:04
  • This is not the best way to ask a question because the specification of hibernation in Windows is not clear and depending on the power possibility of the underlying hardware. Most notably what happens when the battery is completely drought and what the user can do from there is not clearly specified. – dan May 23 '22 at 14:35

4 Answers4

5

Yes, Mac OS X does have this feature. It is known as "hibernate mode" where as the other modes you have experienced are normally known as variations of "sleep mode".

For older laptops (before 2005), hibernation was actually the default mode of operation. For newer laptops that is no longer the case.

You can see the current mode in use with a command line like this:

pmset -g | grep hibernatemode

You can set the mode using a command line like this:

sudo pmset -a hibernatemode 1

Where "1" means hibernation. The default for newer laptops is mode "3", which is known as safe sleep.

Note that you might experience problems in practice with newer laptops. It might not be possible to keep them in hibernation with only the above mentioned command. You can experience that for example external peripherals and the Power Nap feature wake up the computer unexpectedly. YMMV.

If you rather want a GUI utility than fiddle with commands like above, you can use a program such as SmartSleep to set the sleep/hibernation mode:

https://www.jinx.de/SmartSleep.html

Note however that it doesn't seem to support the latest macOS releases, so it is probably only applicable to a bit older laptops.

jksoegaard
  • 77,783
  • To improve your answer, please note SmartSleep doesn't seem compatible with High Sierra and doesn't tell it. – dan May 23 '22 at 15:32
4
sudo pmset -a hibernatemode 25 standby 1 standbydelayhigh 1 standbydelaylow 1 autopoweroff 1 autopoweroffdelay 1

will set the power management policy to force supported systems to enter safe sleep followed by ACPI S5, i.e., power off, upon a user-initiated sleep. Note that this will disable most wake sources, so on many machines the only way you'll be able to wake is by pressing the power button.

pion
  • 4,827
  • Since this answer seems more understandable than anything I searched on web, I ask you for more help. After entering your command, my i-mac 2019 (with Ventura macOS) doesn't hibernate and sleeps like before. Is there any log file or detail that I can provide so you can help me? Thank you in advance. – Omid Ataollahi Jul 17 '23 at 08:43
1

See the attached image to create a shorcut in the Shorcuts app and add a keyboard shorcut to run it. This can be done in the (i) Menu -> Details Tab

How to create a MacOS Hibernate Shortcut

SCRIPT UPDATE:

# Stopping services conflicting with hibernate
pkill SIGSTOP AMPDeviceDiscoveryAgent
pkill SIGSTOP AMPDevicesAgent
tmutil stopbackup

Change pmset settings

sudo pmset -a hibernatemode 25 sudo pmset -a ttyskeepawake 0 sudo pmset -a tcpkeepalive 0 sudo pmset -a womp 0 sudo pmset -a powernap 0 sudo pmset -a networkoversleep 0

Wait for OS sync new settings

sleep 3

Call hibernate process

pmset sleepnow

Wait 30 sec or more for macOS to hibernate

Stops execution and continues when waking up.

sleep 15

Set pmset hibernatemode back

sudo pmset -a hibernatemode 3

Loading stopped services

launchctl start com.apple.AMPDevicesAgent killall Finder

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Jul 02 '23 at 06:13
  • Try to include a transcript in the post in case some people could not see the picture. – Thinkr Jul 02 '23 at 08:08
  • 1
    The script now seems to do way more than the question asked for. Can you clarify your answer to differentiate between the actual answer and any additional information. Also, what is the purpose of the Shortcut? – nohillside Jul 02 '23 at 18:04
  • There are many factors because a macbook can not hibernate 100%. The new script addresses all the the conditions I have found. For example, backup in progress, device discovery, and power setttings that keep alive the computer. Some of these settings must remain changed. Test both and find which one works for you. My macbook is a M1 Max with the lastest version of Ventura. – Caroline Jul 02 '23 at 20:06
0

No, macOS does not have this feature.

There are various tutorials around which will suggest different commands to try to emulate this feature on Windows using the pmset command, but in my experience, it has never worked even close to reliably, and it is definitely not a configuration supported by Apple.

TJ Luoma
  • 20,659
  • 1
    This is incorrect. See my answer for details on how to do this. – pion Aug 28 '21 at 20:44
  • I have tried these methods and they haven't worked for me. If they work for you, great. Not sure if they work for M1-based Macs at all. Definitely not under the category of "supported" for sure. – TJ Luoma Aug 29 '21 at 01:02
  • 1
    They work on Intel and M1 Mac. Check pmset -g cap | grep hibernate. If there is a function which doesn't seem to work for you, make a question ( which might help everyone ). – dan May 23 '22 at 15:04
  • pmset doesn't add hibernate to Mac, it just changes the policy so hibernate happens sooner. MacOS for over a decade has used "suspend to RAM with eventual hibernate" as the "Sleep" function. This is still the case on M1 Macs. With default settings, if you sleep for long enough or the battery is low enough, it will eventually suspend to disk and completely power off before the battery dies. It's similar to, but a different implementation from, Microsoft's "Hybrid sleep" in Windows. – bobpaul Mar 15 '23 at 17:19