Secure Virtual Memory on OS X

Since the purchase of my 2009 MacBook Pro, I’ve had a nagging issue of anytime the machine sleeps for an extended amount of time (30 minutes or more), when I woke it, it would freak out and apps that ran fine before putting it to sleep suddenly start crashing on launch. The system would become so unstable that a full restart was required to get back on track. I’ve always chalked it up to a flakey machine, and that it was something I would have to live with.

Last night, when I cracked the MBP open, I was greeted with a nasty kernel panic which lead to a whole array of disk errors that could only be repaired using DiskWarrior (a huge shout out to Steve Basile (@xebrawerx) for the reminder on Twitter — this saved my bacon last night).

After rebuilding the disk directory, I decided to see if I could get to the bottom of the flakiness once and for all. I started off by disabling every “add-on” utility I had: Growl, TextExpander, Hazel, Default Folder X, etc. Then I got to digging around in the Apple control panels to see if there as a setting I was missing somehow.

When I got to the Security system preference, the “Use secure virtual memory” was selected. It got me thinking that if the VM was being encrypted, and when the machine is put to sleep that maybe something in memory (RAM) or on the hibernation disc image is changing which doesn’t match the encrypted VM somehow on wake, thus causing the machine to not know what’s where in RAM. It’s a stretch, but worth a try I figured.

security_pref.png

So far, by turning off the “Use secure virtual memory” option — which I’d enabled in Leopard 10.5 without issue — the machine seems quite stable, waking without issue. As a (possible) added bonus, performance seems to have increased a touch since the virtual memory isn’t having to be encrypted on the fly.

More to follow if there’s anything worth noting — as in I was wrong in my assumption and my MBP is really a MBL (MacBook Lemon).

UPDATE: Nope. That didn’t fix it. Back to the drawing board. Thinking Genius Bar visit is in order for this weekend. Maybe bad RAM?

UPDATE 2: Decided to completely wipe the machine and do a fresh install of Snow Leopard, along with fresh installs of all applications. A pain in the backside, but the only real way to be sure it’s software related instead of hardware. More to follow…