I have disabled the "Restore windows when quitting and re-opening apps" checkbox in the General preferences pane in Lion, but after a recent sudden power loss (no battery) my iMac restarted in exactly the same state as I had left it the night before. What feature of Lion is making this (miracle) possible, and how do I ensure that it remans enabled?
I read for example that I can "disable Resume", because it "duplicates" something called "Safe Sleep", but I'm not sure what any of these features are, how they are related, or how I can control them. For example, does the behavior I saw in my recent power loss mean that my machine had gone to sleep between my last use and the power failure, or is some kind of snapshotting taking place continuously in the background? I also understand that there are different "kinds" of sleep. If sleep is indeed necessary, do different triggers (keyboard, script, idle, etc.) for sleep result in different "kinds" of sleep.
Best Answer
Resume, counterintuitively, does not actually save anything itself. It simply relaunches all the applications that were running when you shut your computer down. It's the job of those Lion-compatible applications to restore their windows.
Safe sleep, on the other hand, saves a snapshot of your RAM to your HDD when you put your computer to sleep. In case of power failure, the machine boots from this file on startup.
Safe sleep is the only time (that I know of) that OS X saves its RAM.
You can use the
pmset
command line utility (specifically thesudo pmset -a hibernatemode x
command wherex
is the sleep mode) to change the sleep mode, although there is no significant benefit in doing this.The three main different kinds of sleep are as follows (from the
pmset
man
page):As I stated before, configuring the sleep mode is not recommended (again from the
pmset
man
page):I don't know about the script vs. user issue, although I highly doubt there is a difference.