The auto-hibernate ("Safe Sleep") feature in Tiger and Leopard on newer Macs really needs the ability to be fine-tuned. It's one of the first things I typically turn off. While not perfect - there should be a GUI component - imagine my surprise when I went to dump my Safe Sleep and sleepimage from my newly-installed GM version of 10.5. pmset's hibernatemode still allows turning the feature off altogether. But look at this new mode:
"0010 (bit 1), in conjunction with bit 0, causes OS X to maintain system state in memory and leave system power on until battery level drops below a near empty threshold (This enables quicker wakeup from memory while battery power is available). Upon nearly emptying the battery, OS X shuts off all system power and hibernates; on wake the system will resume from hibernation image, not from memory."
Thank goodness! So:
# pmset hibernatemode 2
# pmset hibernatefreeratio 5
# pmset -g
Active Profiles:
Battery Power -1*
AC Power -1
Currently in use:
sleep 10
sms 1
acwake 0
displaysleep 2
hibernatefile /var/vm/sleepimage
hibernatemode 2
Hibernate Free Ratio 5
halfdim 1
lidwake 1
ttyskeepawake 1
disksleep 10
Finally:
# rm /var/vm/sleepimage
Now, my MacBook Pro sleeps instantly, wakes without a hassle, and I save 4GB. Nice.
What if...
so what if your battery isn’t logging itself properly, and just drops out?
No problem
Well, this is only an option on newer machines, so, hopefully you battery isn’t that beaten up yet. In all seriousness, that’s what the hibernatefreeratio parameter is for. There’s no GUI option for this, so, it’s a bit of a geekier thing to do, and as good geeks we’re going to update that value as our batteries get older…or just get new batteries.
I'm looking for
I'm looking for documentation on the updated hibernatemode setting. I realize the pmset man explains what appears to be a new setting (hibernatemode 2) but I can't find any information on this elsewhere. So far, I have been unable to duplicate your results, even using your exact configuration.
Can you acknowledge that this is indeed a new power management setting and that your machine did not simply default to state 0? I see you did not use the '-a' attribute to specify state 2 for all power modes, so I wonder if this may be what's happening.
I've been using a cronjob to switch between state 0 and 3 depending on my battery level, but if state 2 really works as described it would be a much better option.
Also, can you provide any information on the 'hibernatefreeratio' setting? Google only points me back to this blog entry. Why isn't this stuff documented somewhere?
I'm also skeptical that this
I'm also skeptical that this does anything at all, at least on Leopard. I've changed my hibernatemode to 2 and it's definitely still writing to the image file. Same deal with "hibernatefreeratio", pretty much.