I spent some time this morning looking at Chrome's memory usage (on OS X 10.5.8) while viewing flickr.com. First I simply started at my photo- stream page and hit Reload over and over. Next I tried going through all of my photos one by one. I used the RPRVT column in 'top', and the 'heap' and 'mmap' tools to examine memory usage.
Reloading: • Memory usage keeps going up. The renderer starts at about 13MB resident, and goes up a little over 1MB after each reload. I could easily get it up above 50MB. There is some GC going on during the first few reloads, but not after that. Both the malloc and v8 heaps are growing, primarily malloc. • Forcing full GCs brings usage down somewhat, but you have to do it at least five or six times. • Switching to another tab in the same window is the only way to get heap usage down significantly (by calling V8's IdleNotification) and even then it takes over a minute of occasional idle-time GC to have a significant effect. Browsing multiple pages: • Similar memory growth, as above. • Even hiding the tab doesn't bring memory usage down as much. The 'vmmap' tool shows that there's a lot of space allocated to CoreGraphics backing stores, much more than in the single-page case (like 13MB vs 1MB.) I'm not sure if this is for the images on the pages, or snapshots of the pages themselves for the back/forward cache. Safari 4 on Mac has similar behavior. Conclusions: • As already known, V8 isn't collecting enough objects that have handles to big native object trees. • We should call V8::IdleNotification in situations other than a hidden tab. A long-lived tab might go for quite a while without being hidden in this way: the user might activate another app, hide Chrome itself, or just use multiple windows instead of tabs. • There may be an opportunity in WebCore to toss out image backing stores more aggressively. —Jens --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
