In the past couple of months, I started noticing that my MacBook Pro would slow down to almost unusable speeds after a couple of hours of use. This was troubling because my computer was loaded with 4GB of RAM and a 2.66 GHz i7 processor, so it should be plenty fast. Anyway, when I would notice my Mac running extremely slowly, I would generally exit all the apps I was running, and restart the computer. This would solve the problem temporarily, but after a couple more hours of use, my Mac would be running very slowly again.
I started investigating this and what I found was that if you have Mac OS X Snow Leopard or Lion, then Safari is most likely the reason why your system is running slowly. I discovered this by opening up Activity Monitor and finding that two processes, Safari and Safari Web Content, were hogging most of the CPU capacity, and the memory usage would climb significantly the longer you had Safari open.
Once I decided Safari was to blame, I did some Google searches on the topic and found that I was not alone. This thread on Apple’s support forum has hundreds of comments from users who have discovered the same thing. Some of the users note that keeping Gmail open in Safari makes the problem even worse.
Since I could not find a fix that would make Safari stop leaking memory and hogging processor power, I switched my default browser over to Google Chrome and my system is running lightning fast again. I will not be using Safari again until Apple fixes this.
Annoyed by Safari 5.1’s tendency to spontaneously reload pages when you didn’t ask it to? There’s a workaround for it, but it introduces a few problems of its own. Some Safari extensions will not work, and some of the new gestures won’t work either.
If you don’t rely on any extensions, and you can live without the new gestures (specifically, the new two-finger back/forward, smooth pinch-to-zoom, and the iOS-style smart-zoom), here’s how to fix it.
First, you need to enable the Debug menu in Safari, if you haven’t done so already. Copy the following line and paste it into a Terminal window, then quit and re-open Safari.
defaults write com.apple.Safari IncludeInternalDebugMenu 1
You should now see a Debug menu in Safari, to the right of the Help menu (not to be confused with the Develop menu). In this menu, disable “Use Multi-process Windows” by selecting it (when it’s disabled, it will no longer have a checkmark next to it).
Close all Safari windows. From this point, any new windows or tabs you create will have a title that ends in [SP] (“single process”). Safari will not reload any tabs in a single-process window. You can confirm this by selecting “Crash Web Process” from the Debug menu; this would normally trigger the tab-reloading behavior, but with “Use Multi-process Windows” disabled, this will no longer happen.
That’s it. If you end up missing your extensions or gestures, just re-enable “Use Multi-process Windows”.
If you use 1Password…
If you happen to use 1Password, you’ll notice it’s unable to automatically fill in your passwords in single-process windows. Fortunately, the 1Password pop-up (accessible via the [1P] toolbar button) still works, and still allows you to copy passwords and paste them yourself.
Some extensions will not work
Some extensions don’t work properly with single-process windows. In particular, extensions that interact with page content (such as ad and plugin blockers) don’t seem to work. If you find some of your extensions aren’t working properly, you might be able to install an older version of the extension that’s intended for Safari 5.0. I haven’t tried that, but if there are any extensions you can’t live without, it might be worth a shot.
Update: added info about missing gestures.
Update: I mistakenly referred to older versions of Safari extensions as being for Safari 4. Extensions were introduced in Safari 5, and it’s Safari 5.1 that moved to the new multi-process architecture of WebKit2 — i.e. this article actually only pertains to Safari 5.1. On further inspection, I’m not sure the reasoning I offered for extensions not working in single-process windows was accurate, so I’ve removed it.
(You can stop reading here, unless you’re interested in the nerdy details…)
What’s going on here?
So what is a “multi-process window” anyway?
One of the new features in Safari 5.1 is a major new version of the underlying engine — WebKit2. Under WebKit2’s new process architecture, Safari consists of two separate processes — the “UI process” (the Safari application itself, including the address bar, toolbar, bookmarks bar, menus, etc.), and the “web process” (an independent process that loads and displays actual web pages).
Apart from other goals, the purpose of this is to provide some measure of crash protection. While it does prevent the entire Safari application from crashing (at least as far as I’ve seen), it doesn’t protect you from losing anything you’ve typed into text fields in web pages. All web content is handled by a single web process, so if any page malfunctions and causes the web process to crash, all open tabs will be reloaded, and anything you had typed into any of those pages will be lost. Furthermore, any downloads that were in progress will also be halted; you might be able to resume some downloads, but many will have to be started over. This can be very frustrating when downloading large files.
For that reason, the benefits of the new multi-process architecture are somewhat dubious, at least until Apple manages to address the issue of spontaneously reloading tabs (assuming it’s even possible to prevent this behavior without redesigning the overall architecture of WebKit again).
Check out the WebKit2 page on the official WebKit wiki for more details.
Update 5/21/2012: It seems to me that Apple has fixed this auto-reloading bug, but Safari is still flawed. I wrote a post about why Safari is slowing down your Mac.
It’s hard to argue against stories like this and this because any nut job can accuse you of being anti-privacy or an apologist. These stories have some merit, but come on. At what point does this stop? We’re coming up on a year of these types of stories. Next up — BREAKING: Android and iOS can access your processor core.
Nilay Patel has the best response I’ve seen yet:
BREAKING NEWS: Every Mac OS X app can view all your photos!twitpic.com/8qok8b— nilay patel (@reckless) March 1, 2012
Android and iOS are operating systems that run on computers. Granted, these computers are smaller than the ones you grew up with, but they’re still computers. And guess what? In many ways, they work like computers have in past — including the ability of accessing your other files. It’s a feature, not a bug.
I get that mobile devices are the most personal forms of computing yet. And anytime you say that anything or anyone can “secretly copy” your photos, you’re going to get people running for the hills (and more importantly, reading your story).
Not everything done in computing is intended to be nefarious. At some point, you simply have to trust that someone — be it Apple, Google, or an app developer — isn’t out to screw you over. Likewise, when you leave your house each day, you have to trust that you’re not going to be mugged. You may well be, but you can’t live your life in fear of it or you’d never leave your house.
The New York Times apparently wants us to have smartphones that prompt you to make sure you want to turn them on, prompt you to make sure you want to open an app, prompt you to make sure you want to send a tweet, prompt you to make sure you want to jump from an app to a web page, prompt you to make sure you want to adjust the brightness (a stranger may be able to read your phone more easily over your shoulder!!).
We’re one step away from a call for apps that prompt you if you’d like a prompt about something. Excuse me while I go hide in a hut in the woods and write a manifesto.
One of the benefits of a long car trip with my wife is the opportunity to have really great and insightful conversations with the smartest person I know. Yesterday, on the first leg of our trip, we spent some time discussing Microsoft’s many missed opportunities. The failure to take the iPhone seriously. The failure to take the iPad seriously. And, on. And on…
Then I brought up to her what I thought was Microsoft’s biggest miss. That being this:
Microsoft’s DNA is software. They are primarily a software company. The very name of the company is a mashup of microchip and software. And of all of the software they produce, one is more important than all the rest and a huge revenue source that the very livelihood of the company has come to depend on.
Are you thinking Windows? Wrong.
This is also the main cross-platform software they build. Got it yet? Yep.
Why then, instead of laughing at the iPhone, iPad, Android, or anything else that comes along, not employ a strategy of “Office Everywhere” and build platform specific and complementary versions of Office for every device that popped up? That, to me, seemed to be their biggest miss. Can you even fathom how many versions of “Office for iOS” they could have sold at this point? I would guess in the millions.
This, I said to my wife was their biggest miss.
And, as usual, my wife disagreed. She then laid down a thought so insightful, so deep, so damned perceptive, that it just about brought me to tears in its completeness.
You see, she said, missing all of the opportunities was just the start of a much deeper problem. Microsoft for many years had convinced the world that, in order to get “real work” done, you needed Office.
In fact, my many years of Mac Consulting was proof of this. To my clients, Microsoft Office was a “must have” no matter how much I tried to convince them otherwise. And I tried very hard for a while before even I just finally gave up. If a client told me they had to have it I just nodded along and told them what to get and where. They were as sure as the sun rises that, without Office, they would not be able to work, open attachments, write letters, anything. They had to have it.
Then, she explained, the iPhone came. There was no Office. People got things done. Then the iPad came. There was no Office. People got things done. Android came. People got things done. All of those things that they, just a couple of years ago, were convinced they needed Office to do. They got them done without it. And thus, the truth was revealed.
Microsoft’s biggest miss is not the lack of a smartphone, or tablet, or Office apps for iOS and Android.
Like the curtain finally falling from the Wizard of Oz to find just a small, frail, man pretending to be far more powerful and relevant than he really was. Microsoft’s biggest miss was allowing the world to finally see the truth behind the big lie — they were not needed to get real work done. Or anything done, really.
And that will be what ultimately kills them.
The main thing in our design is that we have to make things intuitively obvious,” Jobs told [a] crowd of design mavens. For example, he extolled the desktop metaphor he was creating for the Macintosh. “People know how to deal with a desktop intuitively. If you walk into an office, there are papers on the desk. The one on top is the most important. People know how to switch priority. Part of the reason we model our computers on metaphors like the desktop is that we can leverage this experience that we already have.