Disabling safe sleep for safety reasons.

Discussion in 'macOS' started by mpt-matthew, Jan 2, 2011.

  1. mpt-matthew, Jan 2, 2011
    Last edited: Jan 2, 2011

    mpt-matthew macrumors regular

    Joined:
    Aug 11, 2010
    #1
    Just to check I am making a wise decision.
    Using the widget Deep Sleep (or the terminal) i have decided to disable safe sleep.

    What it is:

    Safe sleep is where the RAM is written to the HD before sleeping so if power is lost the RAM can be recovered (like hibernation) - BUT the RAM is kept live during the sleep so the computer can wake fast.

    Normal sleep (what i have switched to) is where the RAM is kept live but not written to HD.

    Deep sleep is just hibernation, RAM written to HD and power cut to RAM.


    My reasoning for turning it off:

    I am running a new MBP so the chances of losing power are low as the battery cant just fall out (not that it does that on other MBPs).
    I have 8GB of RAM so when i close the lid it can take a good 2 mins to actually sleep.
    Often when i close the lid i am moving the computer (into a bag or whatever), so surely writing to the HD could cause it to break or become damaged (I regally hear the clicking of the HD as it stops due to the sudden motion sensor).
    The fans are on while it is in my bag, annoying and makes me think it might just explode or something (unlikely :mad:)

    What do you think?


    EDIT:
    My method of thinking is that a power outage is unlikely and recoverable; but a HD crash (due to moving writing HD while trying to sleep) could cause big problems - I understand it has a SMS but this is not failsafe.
     
  2. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #2
    When you close the lid, it needs a few seconds to write data to the HDD. Exercise a little patience and don't move it while it's doing this. That's why you hear the SMS.
    It's not going to explode. The fans are simply cooling it off.

    Don't disable sleep. It's not necessary.
     
  3. mpt-matthew thread starter macrumors regular

    Joined:
    Aug 11, 2010
    #3
    I cant just sit around at the end of a lecture for 2 mins! Its sometimes longer if i have more stuff open (yes close the stuff, but that defeats the point of standbye).
     
  4. calderone macrumors 68040

    calderone

    Joined:
    Aug 28, 2009
    Location:
    Seattle
    #4
    The clicking is good, that means the SMS is working properly and protecting you from a head crash. Let the technology do what it is supposed to.

    I don't see a point in disabling it. But, if you want to best of both worlds, get an SSD.
     
  5. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #5
    If it's taking 2 minutes to enter sleep mode, there's something wrong. Usually it takes 15-30 seconds. You don't need to shut any apps down, just close the lid. I just did it and it took 19 seconds to sleep.
     
  6. mpt-matthew thread starter macrumors regular

    Joined:
    Aug 11, 2010
    #6
    My reason is because although the SMS does a good job of protecting the HD, im sure while i am moving around my laptop lots, it is still better for the HD to be off.
     
  7. mpt-matthew thread starter macrumors regular

    Joined:
    Aug 11, 2010
    #7
    Ok, 2 mins is when all my RAM is used (Photoshop is open etc etc).
     
  8. wordoflife macrumors 604

    wordoflife

    Joined:
    Jul 6, 2009
    #8
    I wouldn't disable it. Doesn't seem like a really big deal imo.
     
  9. tjb1 macrumors 68000

    Joined:
    Aug 26, 2010
    Location:
    Pennsylvania, USA
    #9
    I disabled mine as I want it to sleep instant. Saves me 8GB of HDD space also. And partly because of the fact im putting an SSD in there.

    The only time Safe Sleep is beneficial is when the computer loses power because it has wrote the memory to the HDD so a power loss doesnt affect it. So as long as you finish everything up before the battery dies you will be fine and it also wakes faster when in hibernatemode 0.
     
  10. TuffLuffJimmy macrumors G3

    TuffLuffJimmy

    Joined:
    Apr 6, 2007
    Location:
    Portland, OR
    #10
    I just wanted to point out that this part isn't true. Do you really think that when you wake your computer it reads 8GiB of RAM from the hard disk? That would take forever. Safe sleep writes the RAM to the disk as well as keeps it in the RAM. That way if power happens to be lost the previous session is not lost and at the same time the computer can still wake quickly from sleep mode.
     
  11. mpt-matthew thread starter macrumors regular

    Joined:
    Aug 11, 2010
    #11
    Deep sleep is not safe sleep. Deep sleep as described above is the same as hibernation (RAM is stored on HD, then read back during wake up)- where else is your data stored if it isn't on the HD (when power is off)? This is why (as you described) waking up from a Deep Sleep takes longer than a Safe Sleep or Normal Sleep. Deep sleep has a Hibernation mode of 1, where as safe sleep has a hibernation mode of 3, and normal sleep has a value of 0.

    You can initiate a normal sleep by holding down Ctrl+option+Eject for 2 secs.
     
  12. TuffLuffJimmy macrumors G3

    TuffLuffJimmy

    Joined:
    Apr 6, 2007
    Location:
    Portland, OR
    #12
    I think you're still a little confused. There's no way in hell that your computer reads 8GB in the amount of time it takes to wake from safe sleep. The RAM still stores that 8GB of information.
     
  13. tjb1 macrumors 68000

    Joined:
    Aug 26, 2010
    Location:
    Pennsylvania, USA
    #13
    Its called "Safe sleep" for a reason, it writes the ram to the hdd in case of power loss in which it can then read it from the HDD, otherwise it will load it from RAM.
     
  14. mpt-matthew, Jan 2, 2011
    Last edited: Jan 4, 2011

    mpt-matthew thread starter macrumors regular

    Joined:
    Aug 11, 2010
    #14
    Hibernation mode 1 AKA deep sleep AKA hibernation all power is off, you can change the battery, unplug etc. RAM cannot hold data when it has no power.

    You are talking about Safe Sleep which is hibernation mode 3.

    Try deep sleeping your mac, and it will take a while to turn back on.
    PS deep sleep only occurs when you cut all power or put your mac into deep sleep (through terminal, or deep sleep widget).
     
  15. tjb1 macrumors 68000

    Joined:
    Aug 26, 2010
    Location:
    Pennsylvania, USA
    #15
    You are wrong.

    hibernationmode 0 is normal sleep, kept in ram nothing written to hdd

    hibernationmode 3 is safe sleep, kept and loaded from ram, written to hdd in case of power loss

    hibernationmode 25 is full hibernation, memory is written to hdd and then ram is powered off
     
  16. mpt-matthew thread starter macrumors regular

    Joined:
    Aug 11, 2010
    #16
    Thanks.
    I have changed what was wrong, i put that safe sleep was 0, it is 3.
    But you put full hibernation is 25, it is actually 1.

    see here:
    http://www.macworld.com/article/53471/2006/10/sleepmode.html
     
  17. Brian33 macrumors 6502a

    Joined:
    Apr 30, 2008
    Location:
    USA (Virginia)
    #17
    I have to go with tjb1 on this. The MacWorld article and the widget documentation don't match the man page for pmset. At the terminal, do a man pmset and look under SAFE SLEEP ARGUMENTS. Examining the bit fields, I can see why a hibernatemode of 1 can be set and why it acts like full power-off hibernation, but the man page clearly says not to use it. If the Deep Sleep widget is using hibernatemode of 1 (and a quick look at its doc makes it look like it does), I would stop using the widget for that!

    Here's the warning on the man page for pmset (OS X 10.6.5):

    (Emphasis mine.)

    (Although it looks like the only difference between 1 and 25 is whether the dynamic pager is "encourage[d] to page out inactive pages prior to hibernation, for a smaller memory footprint," I still wouldn't use mode 1.)

    Interestingly, the default hibernatemode on my iMac is 0 -- I always thought it was 3. Hmmmm.
     
  18. tjb1 macrumors 68000

    Joined:
    Aug 26, 2010
    Location:
    Pennsylvania, USA
    #18
    You are wrong again, that was taken directly from Terminal.

    type man pmset and scroll down

    it goes 0, 3, and 25

    You going to trust a website or the computer?
     
  19. mpt-matthew thread starter macrumors regular

    Joined:
    Aug 11, 2010
    #19
    Ok, im confused now.

    Anyway...
    When i enable deep sleep (using the widget) my terminal says i am using mode 5 (which apparently, according to all the websites i have seen is the same as 1 but for secure virtual memory). When the terminal says mode 5 (or 1) and i sleep my computer, it turns off completely - upon turn on it loads the RAM from the HD and is in the state it was when i slept it. To me this is what i would call hibernation.
    But - if i use the terminal to change my sleep mode to 25, and then sleep the computer it appears to do the same procedure as above, but it did take slightly longer to load at startup.
    Both seem to hibernate the computer.

    As Brian33[ said (Although it looks like the only difference between 1 and 25 is whether the dynamic pager is "encourage[d] to page out inactive pages prior to hibernation, for a smaller memory footprint," I still wouldn't use mode 1.)

    Perhaps this is a subtle difference between "Deep Sleep" and "Hibernation".
    Deep sleep doesn't save inactive pages to HD to speed up the restart.
    Also, why is mode 1 "not recommended" is there a reason?


    Thanks for all the help.
     

Share This Page