“Why does my machine sometimes reboot itself?” asked my wife one day. “I close it, then open it and it’s gone back to restart. Nothing’s wrong, but it just does it.”
A mystery, certainly: what was wrong with her Macbook? Here we are, having had Macs all the way back to a Wall Street model – that’s circa 1999 – when it had always been simple: close the lid, and it goes to sleep. Quickly. And you never open it to find that it’s rebooted itself. Ever.
I searched around for firmware updates and things like that, but none seemed right for the problem – which persisted.
But this turns out to be a case where Apple has copied something from Windows – apparently because some Apple folk have too much time on their hands and surfed around looking for things that Apple users thought they wanted. Which turned out to be things that Windows users had. Which turned out not to be good for Apple Mac users.
Back in November 2005, Andrew Escobar noted that Apple’s new Powerbooks (introduced in late 2005) did the same thing that Windows machines had done for ages: go for “safe sleep”, where the contents of RAM get written to disk when the lid is closed. He figured out how to do it for other machines. (His post has 300 responses.)
I don’t think though that Apple dreamed this up on its own; people had been talking about how Windows had “Safe Sleep” for ages and wondering if they could hack it. I’m sure I’d seen it discussed before. And why did Apple think it was worth doing?
You’d think that Apple had, by now, got over the “let’s copy things from Windows!” thinking. Sure, there was a little bit of it here and there in OS9, even early OSX, but someone there seems to have been seduced by the fact that some Apple hackers wanted to have their machines copy Windows machine by having a “hibernate” function. Except Apple went too far: instead of giving people the option, someone made “hibernation” – where the RAM contents are written to disk (using less battery) – the default. Not just the default, but unavoidable.
The result: my wife, who’s been a Mac laptop user all the way, found that sometimes she’d put her machine down, and when she picked it up again, it had crashed.
Others had had the same problem and been just as mystified, it emerged: Why does my MacBook occasionally restart when I close the lid to have it go to sleep?
And then the backlash, such as TinyApps: “Apple Safe Sleep sucks“.
Joe Kissell finally nailed it for us all with Stewing Over Safe Sleep: the reason is that when you close your laptop’s lid, it *starts* writing the RAM contents to disk. If you move your machine while it’s doing that, the motion sensor kicks in and parks the heads. Result: your RAM state isn’t written to disk. But the machine will try to start from that RAM image on the disk when you open it up.
It won’t find it – and so it restarts. Bye-bye, unsaved work! As Kissell points out, if you’ve got a lot of RAM, that can mean a wait of nearly one minute during which you mustn’t move your machine, on pain of losing everything, in your mobile environment.
Does that make sense? Surely the thing about laptops is that you’re likely to be jumping about with them. And did the Apple folk forget that we always used to laugh at Windows users, who had to start shutting down their machines 10 minutes before they wanted to go anywhere, while the Mac users would close-and-go? Clearly they did, because there’s no GUI to let you change this option.
It is possible – and Joe Kissell has done us all a service by pointing to the way to do it – but the reality is that this was a really bad call by Apple, seduced by Windows-y things that have no value.
What Apple should do is give people a GUI option to change this. You can have “normal Apple behaviour”, or “normal Windows behaviour”. (I wonder which most people would choose?) I’m only surprised that nobody has kicked together a little GUI tool to do this – Midnight might be the one, but it doesn’t seem like it works.
And just to show that serendipity has its uses, I actually discovered the fix for this after having completely failed to solve the problem, and while browsing John Gruber’s Daring Fireball Linked List. And there it was:
My wife’s MacBook was suffering from a problem where, once or twice a week, the machine would just shut down completely when she put it to sleep. She’d close the lid, and a few seconds later, the machine would just turn off or restart. The solution? Disable Safe Sleep. It hasn’t happened again even once.
So far we haven’t taken the step of trying to disable Safe Sleep, because that involves some hacking which I’d be happy to do on my machine (except it doesn’t do Safe Sleep, and I don’t want it) but am loth to do on my wife’s.