Encyclopedia Lartigue and the Mystery of the Massive Memory

I switched from Firefox to Chrome a few months ago because it seemed like Firefox just kept getting more and more bloated and memory-gluttonous. I don’t run with a million plugins or tabs, but after a short period of time Firefox would just go nuts and get unstable, as it would grab memory and never release it.

Lately I’ve noticed Chrome doing this as well, but only in connection with one site: Google Reader, which I use to read RSS feeds. Every morning I have about 600 or so new items in the reader, most of them being pictures of Lego stuff from Flickr. This obviously would eat up memory but again, I wasn’t seeing the memory being released, even if I closed the Google Reader tab. I couldn’t figure out why. Yesterday, however, I found out what was going on.

The critical tool was “about:memory”, which you can enter into the Chrome address bar to get a breakdown of what’s going on, memory-wise, with various tabs and extensions. Unlike Windows’ Task Manager, which just tells you there’s a process (a tab) grabbing 600M or so, about:memory actually tells you which tab it is, which is key.

Here’s a Google Reader tab as it appears in about:memory:

I just opened it up, there are 609 unread items, and it’s using 151 megs of memory. No big deal yet.

So, as I do, I roll through the items, which will of course use up memory, and I see some Lego pics I want to favorite and open them up in separate tabs. Here’s the thing, though…they’re not completely separate:

As you can see, all this Google Reader activity has made the memory usage swell up to 880M, which is quite a lot. But more importantly, note that the Reader tab plus the three separate Flickr tabs are all included in the same process. All four of them are process 1920. Chrome didn’t start new processes for the new tabs, it added them to the process they came from. And this is the key, because look:

If I close all of the tabs except for one of the Flickrs, it doesn’t free up the memory! Even though the big ol’ Reader tab is gone, now all that memory is being taken up by one measly Flickr image. Only when I close that tab will the 800+ megs be released.

When I go through Reader in the morning, I come across articles and links and stuff that I want to read later. I open them in a separate tab and they hang out until I have time to check them out. And maybe I read them and want to keep them open for some reason. I’m not closing all those tabs, so that big bloated process hangs around. I haven’t checked yet to see if Chrome does some kind of cleanup action at some point, but given what I’ve been seeing, I don’t think that’s the case.

I looked to see if there’s an extension that prevents this behavior by opening children tabs in a new process, but I didn’t see anything. Of course, now that I know how it works, I can manage it manually. It seems to me like a stupid way to do things, but I’m no programmer, so maybe there’s a good reason for this.

I hope this helps someone else who’s been puzzling over weird Chrome memory usage.

This entry was posted in Geek Stuff and tagged , , . Bookmark the permalink.

Comments are closed.