This is a little bit of a dead horse beating, but it’s still relevant, so what the heck, why not. RAM is extremely important to me as a developer for the obvious reasons, so every once in a while, I look around at my processes, and see who’s being an oinker. I was a little surprised at the results.
First of all, a reminder about my dev system: Macbook Pro, running VMWare 3, which is constantly running Windows 7 Ultimate (32bit just now). I keep a number of Mac apps up pretty much all the time. These include Adium, Skype, Mail, iCal and Safari. Safari typically has just one window open, pointing at gmail. Throughout the day, I use Safari a lot, researching technical topics, researching software, reading news. I may have a lot of windows/tabs active during a given session, but I generally close them all down after a while, and go back to the one. For quite a while, I was just using plain old Safari out of the box, no extensions, no nothing.
So, one day, I go looking at my machine, looking for oinkers (BTW, oinker is slang for pig, in this case referring to any process that is being a memory hog), and what do I find? Not VMWare, which is running a whole OS under the covers. No, I find Safari and Flash, at the number one and number two spots. And they are WAY ahead. Both are using around 600MB Real Mem, and a similar amount of Virtual Mem. And this is with one gmail window open. And that Flash Player process will just never die, so long as Safari is up and running. Well, I found that to be more than offensive, and at that level of usage, it’s actually getting in my way, so I spent some time reading up. Lots of people said pretty much the same thing, but there was some variability. Some people really didn’t see the same problem at all. Eventually, I found ClickToFlash, which is a Safari WebKit plugin that stops Flash controls from executing unless you click on them.
So I gave ClickToFlash a try. The Flash process disappeared from the memory profile altogether, which wasn’t too surprising. What was interesting was that when I invoked Flash on places like YouTube, and other sites that have Flash content that I want to see, the Flash process was well behaved, and put itself to bed after the Safari tab in question closed. Safari memory usage still crept up, but it seemed like it wasn’t quite so quick.
Well, I’ll say that AdBlock seems to work pretty nicely. A lot of pages I regularly use got very quiet, visually. Safari’s memory usage still creeps up, but again, not as quickly. I’m still using ClickToFlash at this point.
So, I decided to try a regression, to test out an hypothesis: does Flash memory oinkage (ok, now we’re making slang up. Roll with it.) come about because there are sloppy or maladjusted or malevolent Flash applets in some of the ads? So I kept AdBlocker enabled, and disabled ClickToFlash. What do you know, the Flash process stayed pretty well behaved. I do see it floating around more, and I’ll probably re-enable ClickToFlash, just because there are some sites that use Flash in irritating ways that are not ads, but are still not something I want to see. In any case, it’s my thinking, now, that Flash isn’t entirely to blame for being a memory hog, but I’m still keeping it on a tight leash.
Now, back to Safari. It’s still a piggy. With the three extensions above enabled, the Real Memory usage still drifts up and up during an 8 hour period until it sits, generally, for me, at about 650MB. It usually plateaus there. There’s an additional 600MB of Virtual Memory in use. This past weekend, I spent a bunch of time playing around with Network Attached Storage. I ended up doing a lot of searching on the topic, in conjunction with Time Machine. That will be the topic of another blog post, I can tell you. During that session, which was primarily on blogs and forums, and a few product pages, Safaris Real Memory usage went to 1.6G, and the Virtual Memory to 1.7G. When I closed down all those pages and went back to my one gmail page, Real Memory drifted back down to 1G. I left it overnight, and it was still at 1G. I’m sorry, it’s just a hog. I’ll be fair: I haven’t done the same experiment on FireFox, or Chrome. I should, and I probably will. Right now, I feel like I’ve got back 600MB of Real Memory by nuking the Flash hoarding, and I’ve got things to do, so I’m not going to dig into FireFox or Chrome just yet. If anyone has numbers on those, I’d love to hear them.
Here are links to the three nifty little products that I’ve now got for Safari:OS X, Uncategorized |