Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fix possible hibernation activation in desktop Macs System 10.7
I had some swapping issues the other day on my Mac mini, so I went into /var/vm to check how many files were there. I was surprised to find a sleepimage file; this is a file that is written when a Mac goes into hibernation mode. This file was about 9 GB - or the size of my RAM (8 GB) plus a bit.

Hibernation is only supposed to be used on laptops, but in an informal query of acquaintances (read: Twitter followers), I found that several people had seen this issue after the 10.7.4 upgrade. In addition to the space used, hibernation mode means the Mac takes a lot longer to go to sleep.

This hint from 2006 shows how to turn off hibernation and save that disk space. Essentially, you run the following command:
sudo pmset -a hibernatemode 0
(I didn't run the second command, and it doesn't seem to be needed.)

So, if you've found that your desktop Mac has lost a lot of disk space, check in /var/vm.

You can also check which mode your Mac is in by running this command:
pmset -g | grep hibernatemode
If the result is 0, then you're in normal sleep mode. See man pmset for more information about the different sleep modes.
    •    
  • Currently 4.00 / 5
  You rated: 1 / 5 (8 votes cast)
 
[8,007 views]  

Fix possible hibernation activation in desktop Macs | 6 comments | Create New Account
Click here to return to the 'Fix possible hibernation activation in desktop Macs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix possible hibernation activation in desktop Macs
Authored by: arcticmac on Jun 04, '12 08:09:06AM

I actually like to make a similar modification on my portable machines as well. Specifically, I like to disable hibernate mode for the "AC Power" settings but leave it enabled for the battery settings. Something like
sudo pmset -c hibernatemode 0
sudo pmset -b hibernatemode 3

Where the second command is presumably optional since it would have already been in forced

Basically what this allows me to do is to have the benefits of "safe" sleep while I'm on the go (in case my battery runs low and I can't get to power), but have faster sleep times while my computer is plugged in. I guess many probably don't care about sleep times, but I often like to make sure it actually goes to sleep - for a long time my macbook had issues with that - and so I tend to watch it until it actually has. Of course, you have to be careful that you don't accidentally sleep it on the AC adapter and then let it stay asleep until the battery dies, but that's a pretty long time on a full battery, and if I'm already at a partial battery, I usually just unplug the charger before I put it to sleep so that it will hibernate



[ Reply to This | # ]
Fix possible hibernation activation in desktop Macs
Authored by: slswift on Jun 04, '12 08:33:24AM

I just found my Mac mini with 10.7.4 in hibernatemode = 3. Reading the manage on pmset, it says that state will power down the memory, at least in a laptop. Does anyone know if it would power down memory in a desktop machine?

RAM can be a pretty big power drain and heat generator. I might think about leaving my desktop at level 3 if it meant a possibly cooler sleep state.



[ Reply to This | # ]
Fix possible hibernation activation in desktop Macs
Authored by: arcticmac on Jun 04, '12 08:54:02AM

To quote the manpage (emphasis mine):

     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.

hibernatemode 3 does "powers" not "powers off" the RAM. It simply makes it so that if power is lost while the machine is asleep, that the state can be restored from the sleepimage, which shouldn't be of much concern on a desktop.

If you want to do a real "hibernate" (i.e. power off after sleeping to disk), you want hibernatemode=25 according to the manual. Note that this will make your computer take _much_ longer to wake from sleep. With fast restore in 10.7, you'd probably be better off shutting it down in my experience.



[ Reply to This | # ]
Fix possible hibernation activation in desktop Macs
Authored by: slswift on Jun 04, '12 08:57:08AM

Not enough coffee this morning.
I completely misread that. Makes more sense. Thanks for clearing that up.



[ Reply to This | # ]
Fix possible hibernation activation in desktop Macs
Authored by: edrac on Jun 06, '12 05:50:52PM

After changing the hibernation mode in Terminal on my Mac Pro, should I got back to /var/vm to remove the Sleep Image file? I noticed that the file wasn't automatically deleted after changing the hibernation mode... Now that sleep Mode = 0, it's not needed for anything, right? Thanks.



[ Reply to This | # ]
Fix possible hibernation activation in desktop Macs
Authored by: kirkmc on Jun 07, '12 12:36:10AM

My guess is that it will be removed next time you restart, but you can remove it manually. It's not like swap files that shouldn't be deleted.

---
Mac OS X Hints editor - Macworld senior contributor
http://www.mcelhearn.com



[ Reply to This | # ]