I'm wondering what is a logic of sleep/hibernate of the OS X System.

On the lid closing MacBook should go to sleep - it is obvious but.. What if the machine is running only on batteries and it is in sleep mode for a long time (until complete discharge of the bateries). Does OS X will store RAM on disk to keep user work safe?


It depends on how you have configured the hibernate bits in the power manager.

Setting aside desktop machines which by default to not write anything to persistent storage when the system enters sleep, the default behavior is to write a copy of RAM to storage so that either power remains to wake the machine from RAM or the system will detect the sleep image and restore from that rather than booting from a clean state.

You can set more exotic combinations using pmset and a shell, but it is not officially "supported".

| improve this answer | |
  • I have a Mac Pro running Lion and it swaps RAM to disk. – David Holdeman Dec 20 '12 at 22:49
  • @DavidHoldeman That's interesting. I would assume pmset -g shows a non-zero value for hibernation mode? – bmike Dec 20 '12 at 23:03
  • I take that back. It DID swap RAM to disk, I know because at one point I had a 6GB (The size of my RAM) file at /private/var/vm/sleepimage. I have no idea when or why it stopped. – David Holdeman Dec 20 '12 at 23:08

You must log in to answer this question.

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