Has anyone played with different hibernation modes?

Discussion in 'MacBook Pro' started by tenderidol, Oct 9, 2009.

  1. tenderidol macrumors regular

    tenderidol

    Joined:
    Sep 5, 2009
    #1
    Apparently Mac OS X has three hibernation modes (as outlined below from an official Apple document): a. Always save the RAM content to HD and hibernate (this is the default), b. Dont save RAM content to HD (I think this is the "regular sleep" and risks losing data if power is interrupted), and c. Save RAM content to HD and hibernate when the battery power is at a critical level.

    I am planning to change the default scenario (point (a) above) to the (c) to avoid writing RAM content to HD every time the lid is closed. Has anyone changed the hibernation modes before? If so, has there been any problems with battery life, data loss, etc etc?

    Thanks in advance!

     
  2. RKpro macrumors 6502

    Joined:
    Oct 27, 2008
    #2
    I have a widget on my dashboard called "Deep Sleep", it forces it to hibernate. Because "sleeping" drains the battery too quickly..
     
  3. dazey macrumors 6502

    Joined:
    Dec 9, 2005
    #3
    having being used to quick sleeping G4 powerbooks and never having an issue, I disabled safe sleep as soon as I got my MBP (that was in 2006)
     
  4. tenderidol thread starter macrumors regular

    tenderidol

    Joined:
    Sep 5, 2009
    #4
    That's what I'd like to do as well. I rarely put my MBP to sleep by closing the lid or letting it run unattended for a while. However, for the few times that it goes into sleep, I dont want it to write the RAM content to my SSD which will create unnecessary wear.

    Is that how you disabled it?

    Did you ever try mode "2" (the one where the machine hibernates if the battery level is too low)?

    Thanks in advance!
     
  5. tivoboy macrumors 68030

    Joined:
    May 15, 2005
    #5

    where did you get that widget and how does it work?
     
  6. RKpro macrumors 6502

    Joined:
    Oct 27, 2008
  7. dazey macrumors 6502

    Joined:
    Dec 9, 2005
    #7
    Yes:
    sudo pmset -a hibernatemode 0
    Was what I used. It has even stayed set like that since 2006 without me even having to reapply it. I expected when I did it that I would have to keep bodging it after system updates etc. but it has been permanent.
     
  8. tivoboy macrumors 68030

    Joined:
    May 15, 2005
    #8
    thank

    I actually went to the dashboard site on apple.com and search for deep sleep, sleep, hibernate and it didn't bring up anything.
     
  9. dazey macrumors 6502

    Joined:
    Dec 9, 2005
    #9
    On the safe sleep arguments, I think one of the reasons it came about was that on the G4 powerbooks they had a second battery backup. You used to be able to shut the lid on a dying computer, rip the battery out, slot in a new one and open the lid without loosing anything. When the MBPs came out they dropped the second battery so safe sleep was a way of getting around this backstep. The rapid sleep/wake to me has always been a huge selling point over the XP laptops and something that makes windows users jealous, safe sleep to me is a step towards windows hibernate.
     
  10. misterredman macrumors 6502a

    misterredman

    Joined:
    Oct 3, 2007
    #10
    I use this:

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

    1) smart sleep: sleep if battery charge is above the sleep & hibernate level.
    2) sleep & hibernate when below the sleep & hibernate level. hibernates only when battery charge is below 5% or less than 5 minutes.
    3)sleep: machine will go to sleep only (saves state in RAM only, battery keeps RAM contents)
    4)sleep & hibernate: machine sleeps and hibernates. (default)
    5)hibernate only machine will go to hibernate only. (saves state on disk, battery will not be used)

    Point 2 is a special combination of two standard modes.
     
  11. tenderidol thread starter macrumors regular

    tenderidol

    Joined:
    Sep 5, 2009
    #11
    Thanks for all the replies. Very informative....

    I am still trying to understand what the "default" sleep behavior is when I close the lid of MBP or dont touch it for 15 minutes. Does it put everything into RAM and waits there until it is awaken without writing anything to the HD? If yes, I assume writing the RAM image to HD takes place if you are on a battery power and it goes below a certain threshold. If this is the default, then I dont need to change it because I rarely use my MBP on battery power and even then it doesn't go down to a critical point in a sleep state.

    If the default sleep state involves writing anything to the SSD (in my case), I would like to change it to something else.

    Thanks again!
     
  12. terriyaki macrumors 6502a

    Joined:
    Aug 4, 2005
    Location:
    Vancouver
    #12
    Whoa. This is pretty sweet. Thanks!

    I guess there's one flaw to the second option, though, and that's if you put your laptop to sleep at a high battery level and leave it unattended for a long time. Since it goes to sleep at a high charge it will only save state to RAM but after a long period of time the battery power will diminish and eventually the state saved in RAM will be lost. Not that big of a problem though considering it would probably take a few days for that to happen.
     
  13. Thomas Davie macrumors 6502

    Joined:
    Jan 20, 2004
    #13
    I don't hibernate/put my MBP to sleep. It runs on AC power 5 days a week, then gets taken to work on Fridays, operates on battery for an hour or so, and then wanders over to my girlfriend's house where it gets plugged in. On Sunday nigts it migrates back to my house where it gets plugged back in. Even when I owned Windows laptops they never slept/hibernated.

    Tom
     
  14. eXan macrumors 601

    eXan

    Joined:
    Jan 10, 2005
    Location:
    Russia
    #14
    But surely you don't transport it turned on? You either sleep or shut it down, don't you?
     
  15. misterredman macrumors 6502a

    misterredman

    Joined:
    Oct 3, 2007
    #15
    Default behaviour is the following: when the mac goes to sleep the content of the RAM is copied to the Hard drive (or SSD) and the RAM is kept powered on. That way when you wake your mac it's immediately ready thanks to the RAM content. The copy on the Hard drive (or SSD) will only be used if the power is cut, for example if the battery charge is depleted during sleep, so that you won't lose anything.

    In case of an SSD, if you want to reduce the write you should try to disable writing to disk, at least when the battery charge is still high. A good way to do it is to use the control panel I posted above and select "Smart sleep" as a mode. So basically unless the battery charge is below a specified threshold the content of the RAM will not be written to disk when you put it to sleep. Only when the battery is low and you put the mac to sleep the content will be written to reduce the chances of losing your current session.

    As terriyaki said, the only issue is that the mac has to be on for the control panel to change the sleep mode (to write to disk again) when the battery gets too low.
     
  16. tenderidol thread starter macrumors regular

    tenderidol

    Joined:
    Sep 5, 2009
    #16
    Thanks again for your reply. Now I know what the default is... I'll try Smart Sleep then.
     
  17. Freyqq macrumors 68040

    Joined:
    Dec 13, 2004
    #17
    the nice thing about it too is that you can delete the hibernation file and save x gigs on the hd (x=the number of gigs of ram you have). Also, your computer goes to sleep in about 2 seconds instead of 10 or so. As long as you don't plan on hot-swapping batteries, it essentially works the same as the other mode.
     
  18. tenderidol thread starter macrumors regular

    tenderidol

    Joined:
    Sep 5, 2009
    #18
    So, basically, mode 0 just puts everything to RAM, doesn't write anything to disk and keeps the content of the RAM powered as long as there is enough battery.

    This looks like a good option for me because my computer is connected to a power outlet at 95% of the time. Even when I am using it on battery, I rarely close the lid and put it to sleep. Besides, even if it goes to sleep, as long as I wake her up and shut it down before the battery depletes completely, everything will work fine, right?

    The only drawback is that if in a rare event I forget this and the computer shuts itself off, there could be some corruption?

    Lastly, what's the command to restore it to default in case necessary?
    sudo pmset -a hibernatemode 3?

    Thanks!
     

Share This Page