Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MarckyG

macrumors member
Original poster
Jan 15, 2014
84
44
Germany
Hey all, I'm curious how hibernate works on the MacBook Pros...
I'm used to Windows reserving the amount of RAM in Gigabytes on the SSD, so that it can copy the content from the RAM to the SSD when hibernating.

How does that work on the MacBook Pros / in MacOs?

I'm about to buy a MacBook Pro M3 Max and even though I would love to get 96GB RAM (My Studio with 64GB sometimes isn't enough) but Apple won't let me when upgrading the Max chip... so I thought why the hell not, maybe just get 128GB.
But I'm curious if this will also reserve 128GB on the SSD to use it when hibernating?

Let's not debate about who needs 128GB when and why, first of all I'm just very curious how this hibernating is used on Mac and if you should definitely upgrade the SSD when choosing this much RAM because it will reserve away a portion of the SSD...

Thanks!
 

FreakinEurekan

macrumors 603
Sep 8, 2011
6,456
3,332
I’m not familiar with SSD requirements for Hibernation but…

If you’re worried about not having 128GB free storage, you might need to bump your SSD up just in general.
 

leman

macrumors Core
Oct 14, 2008
19,494
19,631
I do not have the definitive answer to your question, what I can tell you though is that the /var/vm/sleepimage (file that stores the hibernation state) currently takes 1GB on my 36GB M3 Max machine. So it does not seem like macOS reserves a fixed size hibernation file that is equal to the RAM size.

What's more, it does not seem that the file is actually being modified when I sleep my computer. The last time it was modified was a month ago, which is incidentally when I was away on a week-long trip and left the laptop in the office. So I suspect Apple Silicon will usually keep the RAM in an ultra-low-power state during sleep and only write the hibernation data if there is an actual danger of losing battery power.

Overall, the system seems pretty smart. There is hardware RAM compression, super-capacitors that ensure the state is saved if the power is lost, predictive paging, purgeable RAM... I think Apple moved past dumb hibernation long time ago, and they did it in the way that actually works (unlike Windows).
 

MacCheetah3

macrumors 68020
Nov 14, 2003
2,267
1,206
Central MN
My foremost thought:
If you’re worried about not having 128GB free storage, you might need to bump your SSD up just in general.

Anyway… I did find some resources:

What is safe sleep on Mac?​

Mac laptops have a feature called safe sleep. With safe sleep, each time the Mac goes to sleep, the current state of the Mac is saved, including open apps and open documents. Safe sleep prevents your information from being lost if the Mac is completely shut down during sleep, which could occur if the battery runs down or is replaced.

If your Mac needs to access the saved state when it wakes up, a progress bar appears until your Mac is ready to use.

  • Hibernatemode 0 is pure sleep.
    The system state is saved to memory, and the system only wakes from memory. If the computer loses power while asleep, it has to reboot and data not saved to disk is lost.
    This is the default for desktop computers (such as Mac Pro and iMac).
  • Hibernatemode 25 is pure hibernation:
    The current state is saved to disk when the computer goes to sleep, and memory is turned off. Waking happens from disk only. While slow, this mode saves most power and ensures all data is saved to disk before sleep.
  • Hibernatemode 3 is both sleep and hibernation:
    The system state is saved to both disk and memory, and the computer wakes from memory if available or disk if memory has been lost (because, say, the battery was empty and the system had to power down).
    This is the default for mobile computers (such as MacBook Airs).
As an additional twist, macOS can start in Hibernatemode 0 and switch to mode 25 after a while to save power. By default, macOS goes into hibernation (mode 25)

  • after 3 hours with less than 50% of batter left
  • and 24 hours with 50% battery left or more.

Which is also stated in another deep dive article:
Standby kicks in after a Mac has been in basic sleep for a while. For Macs introduced in 2013 or later, this transition happens after roughly three hours of sleep. In contrast, older Macs shift to standby after about an hour.

What Happens to a Mac While It’s Sleeping?​

When a Mac is put to sleep, it enters a low-power state to conserve energy while preserving the current session for a quick resume. Here’s a breakdown of what happens during this process:
[...]
Potential Transition to Deeper Sleep Modes: Depending on your settings and sleep duration, a Mac might transition from standard sleep to deeper sleep modes like hibernate or standby to conserve even more energy.

What about?..
What's more, it does not seem that the file is actually being modified when I sleep my computer. The last time it was modified was a month ago, which is incidentally when I was away on a week-long trip and left the laptop in the office. So I suspect Apple Silicon will usually keep the RAM in an ultra-low-power state during sleep and only write the hibernation data if there is an actual danger of losing battery power.

In my brief research, the single supporting reference I found was in a Reddit thread:
Apple silicon MacBooks do transition from sleep to hibernate, but only when the battery is almost dead (safe sleep feature). When it transitions is not configurable.

Currently, my MBP is using the default Safe Sleep mode (i.e., Hibernatemode 3) and also has a sleep image file size of ~1 GB, which was last modified April 12 — but it has >50% battery state-of-charge. April 12 could indeed have been the most recent date the battery state was in a low power range. So, the only way we’ll uncover this is by having someone do a sleep image file info check when their MacBook battery is at 10% or less (or lower) charge. That is, unless they want to setup some kind of automated file size logging.

Last but not least:
Hey all, I'm curious how hibernate works on the MacBook Pros...
I'm used to Windows reserving the amount of RAM in Gigabytes on the SSD, so that it can copy the content from the RAM to the SSD when hibernating.
My guess is macOS only saves to file the actual amount of memory used. The sleep file image test noted earlier would provide insight into that as well.

Related:

 

snakes-

macrumors 6502
Jul 27, 2011
357
140
@MarckyG
You can easily change hibernate modes, that's fit best for you.

2 years ago I tested different hibernate modes to protect my ssd from too many write cycles, but the sad thing is the ram/memory getting very hot. that's why I ditched the idea and keep it always on. Apples M series cpu are the perfect always on CPU's.
 
Last edited:
  • Like
Reactions: MarckyG

MarckyG

macrumors member
Original poster
Jan 15, 2014
84
44
Germany
If you’re worried about not having 128GB free storage, you might need to bump your SSD up just in general.
That's generally good advice which I'm also probably going to go with, but it doesn't hurt being curious and wanting to know how this thing works ;)
Anyway… I did find some resources:
That's awesome! Thank you so much for collecting that data! That's the insight I was looking for, the Apple document didn't quite answer my curiosities...

I will probably just go with the bigger drive, my bank account will bleed anyway after the purchase so what's a couple more quids :p

That's really good to see some hard data as well... Thank you @leman!

I usually have so much free space on my internal and work with several external large Terabyte drives anyway... then a couple of exports in a stressful deadline day and suddenly the Mac only has 30GB free space on the internal... not good. Strange that all these "purgeable" space won't be set free regardless... So a bigger drive won't hurt.

I was very curious about the topic if I need a bigger drive with that much amount of RAM, because I don't like large internal drives... seduces me to hoard too many files, 1TB was always perfect for me to have approx 300GB free. But there are those days...
Thanks all for the opinions and help!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.