The resource usage of browsers is an important aspect in modern-day computing, because the browser is taking on an ever more important role in day-to-day computing tasks. Hence, it may come as no surprise that many complaints regarding browsers are not about rendering speed or rendering quality, but about resource usage. Dot Net Perls ran an interesting benchmark on Windows Vista SP1, comparing 5 browsers to each other.
The benchmark is rather simple: they wrote a small .Net program called Memory Watcher which polls and graphs the memory usage of processes each 3 seconds. They then browsed the web with each browser for about 3 hours, recording memory usage as they went along. The results show a clear picture of which browser uses the least amount of memory.
Before we get to the results, I must make clear that the benchmark itself is heavily flawed, and that comparisons between browsers can not be made based on this benchmark. The 3 hour browsing session was not the same among the different browsers, and in fact, did not even last as long on all browsers. In addition, each session was different in that different websites were visited. Finally, the benchmark fails to mention detailed specifications of the test machine, other than that it has “3.0Gb+ of RAM”.
Here are the results; the values between brackets are the memory used by the browser at the end of the browsing session (in MB):
- Safari 3.1 (636.9)
Safari on Windows shows extremely poor memory management, and I do not know whether it ever reaches a high water mark. If this is by design, it is certainly a design that looks inefficient and seems to contradict Apple’s marketing.- Firefox 3.0 (111.8)
This browser exhibits memory usage that is by far lower than the others. It releases memory to the system and the trend line is nearly flat.- Flock (based on Firefox 2.0) (191.9)
Flock did very well and this browser and Firefox 2.0 could likely be run for long periods without causing many problems. The extensions probably reduced the efficiency somewhat.- Opera 9.5 (190.6)
Opera’s performance was about as good as Firefox 2.0 (Flock), and it could likely be used for very lengthy sessions. However, Kestrel is certainly not a revolutionary or even notable technology in this arena.- Internet Explorer 8 Beta 1 (194.4)
IE did well in the profile, although a worrying trend in the data could indicate that it would keep escalating. However, this browser could likely sustain many hours of moderate usage.
While the benchmark itself may not be very useful in inducing memory usage of browsers beyond this specific test, the graphs in the article do show a few interesting trends, and do provide a very rough insight into how browsers handle their memory.
Is it just me or does the study show IE8 using far less memory in the short term but growing faster in the long term? So is the winner of the study determined by a flat line or actual low memory usage?
I would say both… a flat line at 1Gb (made up number) would be a bad sign too. But most common complain is when browser over time eat all the memory.
My browser can be running for days… so no leaked of memory is definitively what I am looking for. Mozilla did a great work on that new version for that matter.
Would probably use less memory on Windows if they just used native widgets and font rendering, not to mention it would look better.
I like the font rendering on my mac more than my pc, but I think it looks absolutely terrible on Windows because it looks so different than everything else.
I’m fan of FF, and it’s awesome tabs and speed, 3.0 owns.
Mozilla should make code cleanup too for the next releases.
Of course, lynx would beat them all, easy. Yes, lynx exists on Windows, although it is not that popular (I wonder why). Only links could beat lynx on memory usage.
Anyway, I use Firefox 3.0 not only for its low memory usage, but because it has the best functionalities for me and it looks better to me.
Edited 2008-06-25 17:14 UTC
And DOS would beat Mac OS X, Linux, and Windows Vista.
Not that it really says anything, but hey.
Don’t get me started! CP/M pwns DOS
What I don’t understand is how a browser not using a native UI (thus having all the extra load of an XML/Javascript UI) can use less memory than an entirely Cocoa native-API browser like Safari…
I mean really, how? That one boggles my mind.
edit: on Mac, I should add. Safari/Win doesn’t count, it’s in the same boat.
Edited 2008-06-25 17:33 UTC
Run both browsers through Instruments and then tell us what’s going on? I haven’t got the time right now, but when (if?) I do it might be something worth writing about.
Opera seems like a happy medium. With 3GB of memory, I would hope my browser would be willing to utilize ~5-10% of it during a 3-hour browse session. The higher memory usage can translate to improve performance when its still below a certain threshold.
FF3 using 100-120mb makes me wonder what it sacrifices to obtain that. Does it aggressively return stuff to memory resulting in lost performance while that memory has to be relocated or calculations/routines have to be re-performed?
wow, i said almost the exact thing. Didnt see your post when I wrote mine.
Personally I WANT my browser to use more memory. When you have 2GB or 4GB of RAM, the amount of memory the browser uses is nearly irrelevant.
In fact, I would RATHER the browser keep more cached information in RAM so that I can access it near-instant. If the browser, like FireFox 3, constantly releases memory back to the system, that means 2 things:
1. More CPU cycles (to calculate what to release)
2. More wait time if something you want to see was released from memory.
Do you know that some people use more than just a browser, but dozens of apps. The more effective the memory-handling is the better… <sigh>
I didn’t really care too much about the RAM issue either, but it’s a no-brainer that using less RAM in these cases is better for 99.99999% of people.
From what I gather, FF3 just releases a bunch of caches after certain timeout periods are reached – so that background tabs stop caching stuff you aren’t likely to use for hours anyway. CPU’s are so insanely powerful these days that it might only take 5ms to recreate the caches when needed, and that’s unnoticeable. Meanwhile, if that data was kept in memory and got swapped out to the hard drive it might make the whole system slow.
So yes, FF3 exchanges memory for increased CPU usage. But it isn’t a problem because the CPU usage is still virtually nothing unless you’re running on an i386, and I imagine your performance in those situations isn’t going to be great anyway due to other bottlenecks besides the released caches.
Sure, if your really want I can make you a browser that eats most of your memory no matter what. It will be a simple IE-based browser but it will absolutely use up your memory.
Those two points doesn’t seem very relevant. Stuff like that takes no time.
The reviewer tested Firefox3 without extensions. How much larger is the footprint with, say, a dozen extensions/plugins running?
Just curious.
This test has a flaw because they used 7.0 rendering mode for Internet Explorer 8.0.
It’s actually pretty hard to make a comparison of memory usage. He said he measured private pages, but did he actually measure Working Set, Private Working Set, VM Size, or what? There’s a lot of ways to slice memory and it takes some relatively deep knowledge of how to interpret a particular memory usage pattern’s effect on the rest of the system.
There’s at least one cool memory trick a browser author should consider on Windows: a large memory sink is decompressed images stored in memory for display purposes. It may be wortwhile to keep the compressed versions handy and mark the uncompressed cached image pages with the MEM_RESET flag. I’m not sure how the memory counters will react, but this solution lets youkeepa lot of data around without taxing the system, since pages that are RESET can be repurposed for other programs without writing them to the pagefile or doing any additional bookkeeping. If you call VirtualUnlock() on the pages, you essentially give them back directly to the OS’s Standby List, so it doesn’t have to look into your workingset for those pages. For all intents and purproses these pages are free for the OS to use if other programs need them.
Aside from memory leaks, which Safari seems to suffer from, one shouldn’t be concerned by virtual memory usage of a program unless it appears to affect performance. Reference set and fragmentation are important, however, and it looks like FF3.0 devs have done a great job on this front with lower working set as a happy side effect.
Edited 2008-06-26 16:48 UTC