Saturday, January 24, 2009

Reducing Chrome memory footprint & comparison to Firefox

Google's Chrome is the newest web browser to challenge IE's dominance. One of it's claims to fame is that each Tab (or now, each website) runs in its own process. This means that if a Tab crashes it doesn't effect the rest of the open Tabs.

While great in theory, in practice this turns out to be relatively useless. Chrome is actually about as stable as Firefox, so crashes really are not a problem. Using a separate process for each Tab does use more memory, however. All of the program code is shared between processes, but data is not, and this means that each new Tab has some overhead that would not be consumed in a single process browser. My limited testing, to be described below suggests that each tab takes about 10MB extra RAM, which won't be a big deal of you have Gigs of RAM installed on your machine, but could be quite a problem on lower-end machines.

The good news is that Chrome can be run in a single process mode - which is incidentally how I estimated the amount of overhead for each tab.

To switch Chrome to a single process mode, you need to change the command line arguments to Chrome.exe. I use an icon/shortcut on the desktop to start Chrome, so I just right clicked to get the properties of that shortcut, and then added --single-process to the end of the Target edit field.

I did a really quick before and after test to see how much of a change this made, by loading three websites: gmail, comics.com, and phdcomics.com. These websites are relatively graphic, javascript, and flash rich, which should actually minimize the relative contribution of multi-process overhead to the total memory usage.

The memory usage for these websites, immediately after loading all 3:

Chromium 1.0.154.43
multi-process: 120MB
single-process: 90MB

Firefox 3.0.5: 135MB (no extensions or addons)

As you can see, the single process mode does make a difference. More surprisingly, it looks like Chrome is actually a lot more memory efficient than Firefox. More comprehensive testing would be a good idea here, but at the least, it appears that Chrome is no worse than Firefox.

So for now, I strongly recommend you check out Chrome, and run your own tests. It also has a nice interface, and doesn't waste screen space with lots of "chrome" :-). The only big downside I have seen so far is that it's built in spell-checking facility is really weak. It often doesn't have any good suggestions for more phonetically based spellings, and even typos can sometimes stymie its suggestions. Furthermore, the spell-checking facility doesn't even load on some websites (notably, blogspot). In the mean time, I use FreeSpell, which makes excellent suggestions and works with all websites (and applications) [Disclaimer: I wrote FreeSpell].

2 comments:

angelo said...

Doesn't sound right to me. My tests indicate Chrome takes more memory than Firefox. But I also run a lot of tabs all the time. Maybe you should try with at least 20 tabs to different sites and see what you get.

Thanks for the single-process option. I will try it out and see if it brings Chrome back down to Firefox's level for me.

Sojourner said...

I agree with angelo's post. For the same amount of tabs (and about the same amount of addons), Chrome definitely uses a lot of RAM.

Email me

Name

Email *

Message *