Firefox 3 vs Opera 9.5: Memory usage - Take 2
A few months ago Firefox 3 and Opera 9.5 were compared in memory usage, using beta releases of both spartan browsers. A lot of feedback has been given. Some are simply fans of either browser, but also some where pointing out to the flaws in the article or disregard it completely. Following the advice of those who gave feedback this is a rematch between the final releases, but this time we take a good look at how each browser caches.
You could regard this article as a rectification of the previous one as thanks to all of you I've tried do more research on Firefox 3's new memory usage, as well as Opera's memory usage.
Firefox 3
In Windows Vista Firefox 3 dropped 22% memory usage by using jemalloc, which reduces memory fragmentation by minimizing the total number of allocations. Another new features is the cycle collector which seeks out objects that have references to each other, but are actually unused. Normally garbage collectors, such as found in Java, look for unused objects by looking if they have any reference at all.
However it doesn't all end here. Like a car, or PC, it's important to tweak your hardware. The potential is there, but now to make it a well oiled machine. The caches that were tweaked are the memory cache for images, a back/forward cache to speed up back and forward navigation, a font cache to improve text rendering speed and more. Cached documents in the back/forward cache are expired after 30 minutes. Popular image formats are stored uncompressed for a short while (time unknown, but it should be fairly quick), after not looking at them. This significantly reduces memory as a JPEG of 100 KB can actually be megabytes decompressed. Animated GIFs are now also stored as 8 bit pallet, instead of 32-bit, as this was unnecessary for this format anyway.
Of course memory leaks exist in any C, C++, C# and even Java applications. Mozilla made a lot of effort in locating them and plugging them. For Firefox 3 over 400 leaks have been plugged with the help of leak hunters and detection tools.
Opera 9.5
Opera Software needs no introduction, with a wide variety of supported platforms, such as mobile phones and set-top boxes, they have experience in supporting limited hardware platforms, in the areas of speed and memory. Knowledge on cycle collector's, garbage collectors and memory fragmentation reduction is unknown.
A feature of Opera that's been there for a while is turbo mode. It concerns the caching of images in memory and makes scrolling faster. However, this mode uses nearly 3 times the memory as non-turbo mode. Another configurable setting is the memory caching. Whereas Firefox hides this setting and is tweaked by the developers themselves, Opera does allow you to set it. The default is set to automatic meaning it will take up about 10% of the available memory of your system. This alone explains why people found the previous results to be incorrect, as it was tested on a 4 GB machine, Opera adapts to use up to 400 MB, while Firefox for instance remains to behave the same.
Of course even Opera has memory leaks and with each release new ones may appear, but are also fixed. As there has not been much feedback on bad memory leaks in Opera, their development team is doing a great job in keeping them under control.
Is it possible to compare browsers?
So the real question is, can you compare both browsers in memory usage fairly? The answer in short is: no. Firefox 3 is by default set on a time basis, and Opera uses a memory size basis. Both have different caches, so they can't be compared next to each other. Only on a global scale, with this knowledge in mind we can compare the two browsers. Opera may actually perform better due to the increased memory usage, and it's up to you, as a user, to prioritize use of memory over performance.
For this comparison a special benchmark was done where Opera is set to 20 MB of memory usage, as it was advised by some known unknown source. Following technical advice from Pavlov's memory test for Firefox 3, we'll be looking at memory commit size under Vista (which may be different on other platforms), as this should give a more accurate number.
Hardware
- Intel Core 2 Duo T7100 (1.80 GHz)
- 2.0 GB RAM (DDR2-333 MHz)
- NVIDIA GeForce 8400M GT 128 MB
Software
- Microsoft Windows Vista Home Premium SP-1, 32-bit
- Firefox 3
- Opera 9.5
Preconditions
- Both web browsers are configured with their default memory settings, cleared caches/cookies/history.
- Each browser is cleared and restarted after each benchmark run.
- All pages are loaded completely.
- Firefox 3 has no additional add-ons enabled.
- Opera 9.5 has Opera Link enabled, no mail, no RSS, no BT.
Daily sites
Aeon, AniDB.net, Fantasy Real, Formula 1, ING Card, InterfaceLIFT, Kotaku, MotoGP, Postbank, Tokyotosho, Wikipedia, AppleInsider, Ars Technica, BetaNews, Blue's News, CNET, Gamer.nl, Mac Rumors, Neowin.net, One More Thing, OSNews.com, Slashdot, Tweakers.net and Voodoo Extreme.
Parallel results (multi-tabs opened):
- Firefox 139.676 K
- Opera (auto) 228.088 K
- Opera (auto, turbo off) 230.400 K
- Opera (20 MB) 231.660 K
- Opera (20 MB, turbo off) 225.168 K
Parallel results (multi-tabs viewed, force everything in cache):
- Firefox 197.236 K
- Opera (auto) 276.596 K
- Opera (auto, turbo off) 273.252 K
- Opera (20 MB) 298.660 K
- Opera (20 MB, turbo off) 280.040 K
Conclusion
So again, as far as we can call a winner, Firefox 3 has the crown in sane memory usage. Of course adding add-ons will cost some extra memory, but compared to Opera there is enough "growing" space.
Well, remember I said that we can't compare browser directly. Memory usage, or rather caches have direct influence in how fast a page can be displayed. As this is not a performance test, and it's very hard to indicate UI responsiveness at all, we won't focus on this area in a scientific way. But based on my own experience, scrolling and switching tabs is faster in Opera. Firefox 3 really uses less memory and for normal usage they've tweaked it well enough to not be disturbing in any way. When switching tabs it renders the page in similar speed to Opera (after a little delay of switching the UI). However it's quite interesting to see that setting Opera's memory cache actually had a negative effect on memory usage, while turbo off was an insignificant difference.
In the end, memory usage and performance are two important factors in choosing a browser. But security, standard feature set, and customization are important ones as well.
Well, I've a different machine:
Pentium III 667 MHz
256 MB DIMM PC 133 MHz
8 MB Integrated graphics chip
Windows XP SP3 and...
I'm a graphics design student, so I have to run on that machine Photoshop CS2, Illustrator CS2, Deamweaver 8, Flash 8 (not simultaneously) and at se same time I'm always browsing the web for forums, tutorials, web browsers news, e-mail... and when I use firefox 3, my old machine works some slower than when browsing with Opera, I think that Opera handles memory better in ultra-low performance machines like mine. And if I had a 2GB RAM machine like yours I wouldn't care if Opera uses 250MB, it's just the 12.5% of my installed memory and it rewards me with a great performance. I think (my opinion) is that Opera's folks know what they're doing.
As you point out indeed when you have a large portion of memory it won't matter if it's still taking just 12.5% of your memory. Especially if Opera uses it to actually perform faster, it's a equal trade. With this article I wanted to show the memory usage on my laptop, and also point out the different strategies each browser maker has made, including regards to performance,
It's too bad that performance, such as tab switching, and page scrolling can't be measured easily, but Opera does come out as a winner in this area for me.
However my only question remains is why setting the memory cache manually, and disabling turbo mode has no effect?
Yes, is very interesting that about using TURBO and not using it. But as I see on Opera's documentation, TURBO mode is not intended to afect memory usage as it is enabled or disabled, the opera's docs only says as a description of the feature: "Draw images instantly" but it doesn't says that memory consuption will be afected. Maybe Opera's devs could help with a more accurate description of how it works.
descriptio of TURBO: http://www.opera.com/support/usingopera/operaini/
IF you like to real test:
- Open all your browser(Firefox, Opera, IE, Safari) and let all of them be running.
- Then open this link in all browsers: http://nontroppo.org/timer/progressive_raytracer.html
- Click on the "Basic Render" several times in each browser
- Open Task Manager and look at the Memory
Result:
After 4-5 times click on the "Basic Render" in each browser, Firefox 3 get slower and slower and eating up all your memory.
I really don't want to heart Firefox, I think they have done a great job in promoting a alternative Browser to IE. But Opera is a faster/safer/smaller browser then Firefox but are not that good in marketing.
Firefox 3 requires more memory than Opera
This test is a fake
This is only a short test on a complete different hardware setup and thus the results may vary on lower, mid and high end computers.
Opera's memory cache will throw out images that are no longer referenced by any visible document after 10 minutes, so maybe redo the test and wait for 10 minutes to get accurate readings.
Thanks for the info Petter, perhaps you could also help in explaining how Opera behaves on low, mid and high end computers, which already results in quite different numbers?
I've read these two articles with interest, and all the comments they've generated. They've certainly encouraged some stimulating debate... However, you can only judge the two on what you see in front of you and I suspect that most people will see that Opera 9.5 uses less memory than Firefox 3, considerably less on my machine.
I use both, they're both very good browsers. But Opera uses less memory and is much quicker than Firefox, on this and other machines that I use. I have to say that I find Firefox 3 disappointing in that respect, I expected better... as did many others.
It just seems that the Opera people have done a better job on this. As for Firefox.. what is the point of developing a browser that relies so heavily on add-ons, when the add-ons slow it down so much when used?.. and send the memory usage rocketing even more.
Thanks for the two articles, you've done the tests and given your honest opinion. But on a daily use basis I feel that most users will find Opera to be the one that doesn't take up so much of their system resources... and to most people that's what matters. Firefox was all was hype... Opera simply got the job done.
Normally garbage collectors, such as found in Java, look for unused objects by looking if they have any reference at all.
Actually that's not really the way the Java garbage collector (from Sun) works. It uses (among others) a technique in which "live" objects (that can be traced from "roots") are copied into a different part of the heap, while the rest of the objects (that either aren't pointed to by anything, or have cyclic references) can be collected (basically, it's a combination of mark-and-sweep and stop-and-copy). More info about the algorithm used by Sun's Java can be found here.
You make it sound that Firefox's new garbage collector is now better than "normal" garbage collectors (or at least Java's), whereas in fact it used to be worse (because cycles didn't get collected) ;-)
Just looking at the number of references to see if they have any reference at all is called reference counting (as opposed to tracing).
Popular image formats are stored uncompressed for a short while (time unknown, but it should be fairly quick), after not looking at them.
Seems to be 15 seconds, which is less than the original 45 seconds.
Right; there is no perfect browser, even to this day and in the 21st
century, no less! They all have annoying problems and lack features
that they should have had long ago, if not from day one.
That said, I've found this one to be generally the most stable under
NT/2k/XP/Vista(!) and I have used all of them, moving back and forth
between them, dumping each one in turn as I have become disgusted.
This is a streamlined, *real* browser, not for those who want all of
the bells and whistles, but hopefully it will suit some of you who
are, like me, constantly irritated by the other browsers.
Good luck!