Google Chrome Memory Usage - Good and Bad
Friday, September 19, 2008
A lot of smart people are doing some serious tire kicking on Google Chrome. Now with several days of testing under their belts, we're seeing many observations about Google Chrome's memory usage. I've just posted a techie document about memory over on the developer website as an initial brain-dump of our current thinking about memory usage within Google Chrome. This article is a quick summary.
Measuring memory
If you're measuring memory in a multi-process application like Google Chrome, don't forget to take into account shared memory. If you add the size of each process via the Windows XP task manager, you'll be double counting the shared memory for each process. If there are a large number of processes, double-counting can account for 30-40% extra memory size.
To make it easy to summarize multi-process memory usage, Google Chrome provides the "about:memory" page which includes a detailed breakdown of Google Chrome's memory usage and also provides basic comparisons to other browsers that are running.
Multi-process Model Disadvantages
While the multi-process model provides clear robustness and performance benefits, it can also be a setback in terms of using the absolute smallest amount of memory. Since each tab is its own "sandboxed" process, tabs cannot share information easily. Any data structures needed for general rendering of web pages must be replicated to each tab. We've done our best to minimize this, but we have a lot more work to do.
Example: Try opening the browser with 10 different sites in 10 tabs. You will probably notice that Google Chrome uses significantly more memory than single-process browsers do for this case.
Keep in mind that we believe this is a good trade-off. For example; each tab has it's own JavaScript engine. An attack compromising one tab's Javascript engine is much less likely to be able to gain access to another tab (which may contain banking information) due to process separation. Operating systems vendors learned long ago that there are many benefits to not having all applications load into a single process space, despite the fact that multiple processes do incur overhead.
Multi-process advantages
Despite the setback, the multi-process model has advantages too. The primary advantage is the ability to partition memory for particular pages. So, when you close a page (tab), that partition of memory can be completely cleaned up. This is much more difficult to do in a single-process browser.
To demonstrate, lets expand on the example above. Now that you have 10 open tabs in a single process browser and Google Chrome, try closing 9 of them, and check the memory usage. Hopefully, this will demonstrate that Google Chrome is actually able to reclaim more memory than the single process browser generally can. We hope this is indicative of general user behavior, where many sites are visited on a daily basis; but when the user leaves a site, we want to cleanup everything.
You can find even more details in the design doc in our Chromium developer website.

44 comments:
eusouotiago said...
some scripts of google groups doesn't work in Chrome.. They ask for Firefox ou Internet Explorer :-(
September 19, 2008 1:51 PM
bacon said...
One thing I don't understand, multiple processes are touted as a good idea for security, but they are capped. If too many tabs are open, processes are re-used.
That is analogous to an operating system "running out" of processes and deciding to combine the virtual memory of multiple processes.
It seems to me that is an unnecessary compromise. Why not put each tab (or site) in its own process, no exceptions? Or at least, offer an option "secure mode" that guarantees it, or better yet, "insecure mode" that removes the guarantee.
September 19, 2008 2:01 PM
Chuck L. said...
...It's not replacing my Opera browser anytime soon. Do the "upsides" slow down quickness or the browser? I don't mind the hogging of memory so much as losing spedd/quikness.
September 19, 2008 2:07 PM
Richard Bradshaw said...
I wrote about this when Chrome was first released - just using one tab in a number of browsers I found that Chrome still used less than everything except Opera - have a look at my blog post for more details.
September 19, 2008 2:30 PM
Jim said...
I am curious as to what Google Chrome's dev team sees as the "standard use case"? Is it a user with 1-3 tabs open who closes tabs religiously when they're done with a site? It is someone who opens tabs and doesn't care and never closes them? Or is it someone like me, that lives all day with a certain number of tabs open (lessee - Gmail, Google Reader, Google Groups, Facebook) and transiently opens others (often repeatedly) off and on over the day and closes them when done (which for me would be Blogger, MySpace, Weather Channel/Weather Underground, LinkedIn, etc., etc., etc.)
So far I've been using Chrome since Sep. 3, and like it and haven't noticed it being too hoggish on my work laptop (XP, 2GB). Perhaps if the machine were more memory constrained I'd care more.
September 19, 2008 3:03 PM
Mike Belshe said...
@bacon: I agree. There are more interesting cases than the 20 tab case (which is rare). For instance - when one tab is opened from another via common javascript they'll load into one process. More work is needed, but hopefully this is an okay start.
@richard: thanks for the pointer.
@jim: I think there are many use cases about how many tabs are active. We need to collect better data and adapt the model. It would be great if chrome could learn this from user behavior and adapt.
Also, I think low-memory machines is where the multi-process model shines most. A user may have 5 tabs open, but only really use 2 of them. The memory for those other 3 tabs can be swapped out without affecting the two tabs in use. A single process browser would need most all of its pages active - even for those unused tabs.
September 19, 2008 7:21 PM
Pepsiman said...
> For example; each tab has it's
> own JavaScript engine.
s/it's/its/
September 20, 2008 8:53 AM
Patrick Roberts said...
it's funny, the more i use Chrome, the more unstable it seems to get; it crashes a lot more, can't handle sites with flash, hangs every time i close a tab... all that to say, i've switched back to Firefox
September 20, 2008 2:57 PM
Digitalxero said...
@patrick roberts
Thats strange because I have had chrome open since the day it launched with only a single restart when it needed to upgrade, and have yet to have the whole browser crash, though I have had a tabs or groups of tabs (when they for some reason end up in the same process) crash. As for flash I have yet to find a flash site that Chome does not work with, though I admit I don't visit many other then Hulu.com or youtube.com
My usage pattern is Gmail always open, and usually six to eight transient tabs (some of which may be open for days before I close them)
September 21, 2008 12:29 AM
ii said...
Seems like a good browser, simple, easy to use, stable from my usage so far. I use a relatively old laptop with only 0.5MB of Ram - so far no problems with multiple tabs open. Well done, keep up the good work
September 21, 2008 2:44 PM
redone said...
Great browser. I use FF and IE. Loads pages and runs quicker but does lock up more than the rest on flash driven content though.
September 21, 2008 7:25 PM
Edwin Vázquez said...
I have been using Chrome continuously since it became available and I have come to love it. Every now and then I do fire up Firefox (i.e. because of specific add ons).
It's true that Chrome crashes sometimes with certain pages that have Flash embedded. But it's not Chrome that crashes but the specific tab that was opened.
The main reason I'm using Chrome is because of my heavy use of Google Docs. They are so well integrated that even with Firefox it's not the same.
Of course, all the time I keep in mind that this Chrome is still in beta.
September 21, 2008 11:17 PM
David Hulbert said...
I've noticed that although Chrome doesn't use loads of memory, it page faults quite a lot on my machine (Win XP). No specific stats, but ithad more PFs in half an hour with 2 or 3 tabs open than Firefox did in about 4 hours with 20 tabs open. Just tried it again and it's got over 100,000 PFs in 5 mins.
September 22, 2008 1:03 AM
brainobeast said...
certainly intranet url's are taking a lot more time to get loaded in chrome. As a whole it has speed in loading. It could be more useful if gmail,gtalk are bundled with that.
Regards
BrainOBeast
September 22, 2008 1:18 AM
Royi Avital said...
Great Post.
Just try to keep each process as "lite" as possible....
September 22, 2008 2:53 AM
Kevin Quillen said...
You guys are doing a great job. For the first version of the browser it feels much better than Firefox initially did.
September 22, 2008 4:26 AM
Frank Pitts said...
I have been using Chrome for around three weeks and have now made it my default. It has not crashed on me once. It is really fast and integrates so well with Google Apps. Great job. I look forward to the next release.
September 22, 2008 12:20 PM
Jimmy said...
I like this a lot more than Firefox or IE. I definitely can't wait for the Linux release. Only problem I'm having is with flash or shockwave apps.
September 22, 2008 12:51 PM
Jesse said...
@Pepsiman
That's what she sed.
September 23, 2008 12:30 AM
mdm-adph said...
About the memory problem from having eacf tab in its own process -- ever thought about making an option where a user could open a new window, and all the tabs in that window share the same process? A lot of times, I'll be using a web app that uses many windows/tabs, and I wouldn't mind all of these sharing memory.
September 23, 2008 5:59 AM
Erus Lupus said...
Well, I actually miss that resource from Firefox which keeps a list of entries for a text field.
It prevented me from typing my e-mail or personal data a lot of times.
I hope you guys work it out soon. =)
Great job with the browser. ;)
Cheers!
September 23, 2008 10:08 AM
Raf said...
I thought it was gonna be a common problem, but it looks like i'm the only one. I'm talking about that after 20 seconds or so, chrome crashes... every time.
Running xp sp3
September 24, 2008 5:58 AM
Erico said...
September 26, 2008 7:58 AM
Erico said...
Greate ! Running for about 10 days in Ubuntu 8.04 and just small problems. This browser is a total diferent prouch to the internet. I´m excite to see the linux version. Even alfa.
September 26, 2008 8:00 AM
Sheldon said...
I've experienced some problems, i.e. when viewing photos on Facebook, but I love how fast it is.
September 27, 2008 5:05 AM
A United States Non Provisional Patent Applied Service said...
I have a serious problem with Chrome.
CCleaner, Revo, Advanced Windows Care and DISK CLEANUP did not clear internet history.
This is a big smokescreen and now Google is not just in the search business or Predictive Text Analytics but the cookie business.
Don't kid yourself, information is power and power makes $$$ and how much to charge advertisers based on ie history. Every exit page can be tracked because you in fact are being followed. The disclaimer is the incognito feature BUT why do I need to archive my most recent bookmarks? I think it's cool but need to know if there is data being collected by Google about my bookmarks. The price of poker just went up as they say...
September 27, 2008 10:49 PM
axl rose said...
Y CANT CHROME WORK WITH FLASH AND/OR SHOCKWAVE ?
September 29, 2008 1:18 AM
Erico said...
axl rose
Open chrome, go to google, type "install flash", open the first page, folow the instruction.
September 29, 2008 3:24 AM
ii said...
.
September 29, 2008 4:04 AM
Jeroen said...
i have a problem with chrome.
the memory usage is not much of a problem to me.
though the percentage of processor usage is enormous. my entire system either slows down or entirely stops running for a certain amount of time when i click a link, scroll down a page, or only just start chrome. the processor usage runs up to 40%, even with only one tab open - without flash or shockwave content -.
now im not running on the fastest system available, but i haven't experienced anything like it with either FF or IE. i have an AMD64 3400+ (single core). IE and FF both take up no more than 3% of my processor with several tabs opened.
am i doing something wrong? or am i not the only one?
September 29, 2008 10:33 AM
Harri said...
For single and multi process browsers, a more fair test would be to open the ten tabs, then close nine of them and open nine new tabs. And measure the memory usage at the different points. This is because a single process browser won't (easily) move the memory barrier when memory is freed, but can reclaim the unused memory in it's memory space.
A single process browser will normally reuse it's freed memory that can't be measured by a typical external memory measurement tool. If the memory is not reused, it will end up swapped out. It's true it can be wasteful use of resources (memory, swap space and IO), but this shows there are details that can be too easily neglected by a simple "open 10 tabs, close 9" test.
There's also fragmentation in the virtual memory space of the process that can make a single process browser's memory use less efficient, unless taken care of.
September 30, 2008 12:42 AM
GUS said...
Chrome crashes on YouTube and anything with flash video or complex shockwave I think. Why is this?
October 6, 2008 9:33 PM
Lenith said...
Its run good untill it faces some shockwave content. I get crashed whenever web page have some shockwave. It needs to fix. I'm tired because lot of web pages runs shockwave and if its goping to be continue i have to think to switch it to some other like FF or IE.
October 7, 2008 5:36 AM
Suni said...
thritto on the shockwave thing. it's getting really really annoying. i like to use this browser as an easy see all thing when im not working. i see i will be using FF3 much more if this shockwave issue isn't put to rest soon. i dont want my fun browsing screwed up because of shockwave crashes every few minutes.
October 11, 2008 11:21 AM
GUS said...
my bother said that if you install the flash and shockwave stuff for ff3 on ff3, then you use the chrome it worn't crash
October 16, 2008 7:44 PM
Desertlover said...
I have to say like jeroen, (and I'm not a computer expert) but after I started using chrome my laptop slowed down, sometimes freezing up completely for several minutes! This with only one or two tabs open.. when I checked cpu usage at the suggestion of a friend it said 100%!! And now always does, even though computer was 3 years old it should not be that bad; I just got a new laptop but won't be adding chrome anytime soon, which is too bad as I like the layout..
October 19, 2008 5:33 PM
Roshi said...
i dont like it. it takes alot of memory. and plus..google is not coming out with a new update because THIS CHROME thing doesnt even let me TYPE MESSAGES on hotmail
HOW PATHETIC!!!
November 2, 2008 5:15 AM
IMS said...
My browser also crashes in 20 seconds...RAF I am with you. No debugging information. Have uninstalled and reinstalled many tomes to no avail.
November 14, 2008 12:48 PM
vijay said...
Please fix the fact that we cannot write an email using chrome on hotmail website. don't blame MSFT as Firefox still works even though MSFT did upgrade the hotmail website :)
November 15, 2008 11:05 PM
Mac said...
It seems to me that a great deal of attention went into security and technical streamlining, memory usage etc,but that the "layman" who uses the internet as a tool and for recreation was left behind.
(E-mail, G Mail Face Book, common use items such as Flash and Shock Wave, research and plain browsing). I agree with the sentiment that archiving Recent Bookmarks, having my History on the page are not necessary! It is a fast pain in the butt! Mac
November 22, 2008 2:15 AM
Darren said...
@ Roshi and perhaps a couple of others:
Yes, it may use more virtual memory than other browsers because of its multi-process design, but it is not a requirement that all of this memory is mapped to physical memory at any one time.
This means that when a process is not being used, its entire memory space can be swapped out to allow space for something else (not necessarily another Chrome process. This allows for much more efficient memory management potential by the Operating System than single process designs.
Also, this is the cause of the page faults some people may be noticing.
November 22, 2008 4:21 AM
Vinod Kumar Saini said...
January 6, 2009 3:00 AM
S. said...
My whole Chrome crashes - often. Not just a tab, the whole thing, tabs and all. Often.
XP SP3
P4 2.8
2GB RAM
May 24, 2009 3:26 PM
Anthony said...
Running the just released OS X version: every Chrome process shows in Activity Moniter as "Not Responding"
In fact, all my tabs are fine.
I'm curious as to why Activity Monitor sees Chrome this way?
June 6, 2009 8:01 AM
Post a Comment