Inside the Improved Firefox 3 Memory Manager

Mozilla software engineer Stuart Parmenter explains the new and improved inner workings of the Firefox 3 memory manager and what was involved in the quest of decreasing the browser's memory load. Not simply all about fixing memory leaks, it involved solving memory fragmentation issues as well, as Windows and most other operating system allocates memory in blocks and may not "see" small enough fragments of memory as usable in practice.

View: Firefox 3 Memory Usage

Report a problem with article
Previous Story

Microsoft Adding Sony Blu-ray Support To Windows

Next Story

TeamViewer 3.5 Build 4140

32 Comments

Commenting is disabled on this article.

No google Sync, no switch over yet for me :(

Though i did try it for a bit, seemed abit better than the current release version.

well as far as my own personal use as far as i can tell it does seem (according to the memory use in task manager) that Firefox3 BETA 4 uses noticeably less ram than Firefox 2 did in general as i tend to have open alot of tabs and reloading alot of stuff etc etc at a time and had it running for hours and it does seem the memory use is noticeably less than it used to be, although nothing drastic ;)

but it's a pretty noticeable improvement when is all said and done

On Topic: This improvement is very good. I've had problems with Firefox only few times, but for those who have problems very often, it is surely a welcome news.

Off Topic: I wish more sites used Silverlight, as it seems better than Flash.

I tried both, normally I use FF2 but I have Safari and Konqueror as well. Works fine with me, I like the full page zoom, but the graphics scaling algorithm produces weird edges. Works fine with all the pages I regularly visit and my bank as well. I like the new address bar search. Widgets seem better rendered. Didn't really notice a difference in memory usage but I never really had any problems with it (running on Ubuntu 7.04, gonna upgrade when 8.04 comes out). Didn't try it on OSX, still using 2.x. In Windows, same.

Im not sure what everyones problem with FF2 is. Im running 2.0.0.12 and I had 18-20 of my bookmarks open and it sat around 106mb. And thats with 14 extensions.

Pretty nice...

FF3B4 with 15 tabs open was roughly 70mb on Vista, with the only extension used being adblock plus. It started out with only 1 tab (this page) at around 45mb. Since I closed everything they have steadily been dropping and is sitting at around 60mb as I type.

Too bad they didn't compare it to Opera. Since it's developed for systems like mobile devices and the Nintendoo Wii where both leaks and fragmentation more easily can cause crashes it should perform very well. Maybe the same for Safari (with its iPhone version).

For me it works very good. Memory usage is pretty acceptable - definitely an improvement over FF2. In similar usage scenarios with FF2 I'd easly go over 200MB where now it hovers around 100MB (that is with several tabs open - Yahoo Mail, Gmail, Flash sites, and several others). I only use essential add-ons (adblock, firebug, ie tab and measure it) and no themes and so far so good.

The only thing I'm missing is Foxmarks. I hope they make a FF3-compatible version of it soon.

Firefox seems to have more [memory] trouble with loads of add-ons.

There are a few I like to use, like Tab-Mix Plus for example, but I can't leave the browser active for more than a day before pages start rendering really bad, video stops working and even links don't open.

Without the extra add-ons Firefox isn't half bad at all. Firefox 3 is definitely an improvement over 2 (from Beta 4 onward).

Yes, I think this is a problem with plugins in that they don't go through the same kind of quality assurance as Firefox at all. :-/

However, at least Firefox 3 beta 4 seem to work at fixing whatever can be fixed even in this area by better trying to release what can be released also as for extensions. But I guess it still can't fix sloppy programming so I guess this problem will most likely remain to some extent.

I haven't been able to get tab mix plus to work on beta 4 at all.


I have a lot of addons and they do eat memory more then a standard fx install.

(eilegz said @ #7)
firefox 3 its faster, not faster than opera but its ok.

Actually, it's much quicker than Opera now. Plus,of course, combined with all the other pluses of Firefox, it's much better in every way.

Im using last nights Nighly at the moment, but yesterday was the nightly from the night before. Im assuming the memory usage is around the same (Probably slightly more). But i always have at least 3 tabs open and generally 2 windows as well. Running complex sharepoint sites with lots and lots of data, with this site always open, as well as gmail, and google. The memory usage as far as i can tell never goes above 90KB. I'm running it on a Vista enterprise x64, and my home system with Ultimate x64 handles it about the same. I am also using 3 or 4 extensions, but no theme.

I would say fairly better than FF2, but way out there in terms of IE.

In conclusion, Firefox 3 will be the version were the world converts.

I think it was overall a good article, but I now see something I'd liked to have seen more info on, which would be the behavior if they after that final graph would have re-opened 30 (different) windows again, closed those, etc. Because this would simulate the long term browsing behavior. What I'm most interested in is how much memory a browser consumes after tabs have been opened, closed, and then other tabs have been opened and closed again. Their final test just displays the results as tehy opened the tabs and then closed them all, not what happened afterwards. Will the "terminal size" just keep rising or flatten out too?

its not nearly as bad as IE 8 Beta 1 which uses around 150mb with just a single tab open...

firefox 3 beta 4 with 4 tabs htis aorund 30mb for me...

I think your memory counting is a little off, at least for IE ;)

I have IE8 open with 5 tabs right now, and I'm using 155mb.

And 30mb sounds waaaay too low for FF with ANY tabs open. Maybe if it was bare-bones (no add-ons).

You guys must be visiting some memory heavy sites or something. I've got IE8b1 open with 10 tabs and it's using 90MB

It DOES use more memory than what IE7 did. But this is a developer beta with lots of stuff going on that's not final. Beta 2 and up will be a better sign of things as far as IE8 goes.

(The Burning Rom said @ #4.1)
I think your memory counting is a little off, at least for IE ;)

I have IE8 open with 5 tabs right now, and I'm using 155mb.

And 30mb sounds waaaay too low for FF with ANY tabs open. Maybe if it was bare-bones (no add-ons).

My Firefox uses 76Mb (6 tabs) with IE Tab, Gmail Manager and NoScript. I've personally found IE and Opera to be higher (I've had Opera go as high as 200Mb with 10 tabs). It really depends on the exact setup, IMO.

(The Burning Rom said @ #4.1)
I think your memory counting is a little off, at least for IE ;)

I have IE8 open with 5 tabs right now, and I'm using 155mb.

And 30mb sounds waaaay too low for FF with ANY tabs open. Maybe if it was bare-bones (no add-ons).

Firefox3b4 with just this page open is at 31MB for me. Only add-on I'm using is adblock+

It's nowhere near as bad as FF2. The article is saying they did a -LOT- of work on the memory management for Firefox 3 and it's a lot better than FF2.
They've also implemented methods to catch out memory leaks from extensions and new code, so from this point onwards, Firefox's performance should only improve.

I've been using FF3B4 all day, with multiple tabs open and right now it's using about 110Mb. I've yet to see it go much higher than that.

EDIT: I just did some testing. Obviously these aren't conclusive, but they're good enough for me.

With 4 or 5 tabs open and approximately 6 hours of uptime, memory usage was hovering around 110Mb.

I opened up a whole bunch of new tabs (blank ones). I counted about 20. Memory usage went up by about 10kb. When I close all of the blank tabs, memory usage actually dropped by about 2Mb, less than before I opened the blank tabs (I'm guessing this was due to Firefox removing uncompressed images from memory, as detailed in the above article).

Next, I opened up my homepage in about 15 different tabs. This is a google homepage with quite a few elements on it, although not many images. Memory usage was now at around 111Mb (an increase of approximately 3Mb).
Closing them, memory usage quickly dropped once again to around the 110Mb mark.

For my final test, I opened my bookmarks, right clicked one of the folders and selected "open All in Tabs". Firefox gave me a warning that I was about to open 18 tabs (Note: All of these sites had varying amounts of scripts, images, etc. on them). I clicked ok.
All of the tabs loaded very quickly, less than a couple of seconds (and by loaded, I mean the pages had completely loaded, with all elements displayed) and memory peaked at about 118Mb.
I started closing the tabs and before I'd even closed half of them, memory usage had already dropped to 111Mb. By the time I closed them all, memory usage was down to 108Mb and has stayed there as I typed this.

I should also point out that I'm using around 10 extensions as well.

Improvements? Definitely.

So is this saying Firefox 3 is not a memory hog anymore and doesn't take up as much memory as it should?

Or is this saying that they are still working on it and it's still nearly as bad as FF2??

(cJr. said @ #1)
So is this saying Firefox 3 is not a memory hog anymore and doesn't take up as much memory as it should?

Or is this saying that they are still working on it and it's still nearly as bad as FF2??

It's saying that they have a new technology in place. New technologies typically are introduced because they will build a good basis for the long term. Hopefully the original problems that were found (through bug reports) will be corrected by Firefox 3 and the added memory manager will go above and beyond going to help with those problems. Surely not every problem will be found by the release of Firefox 3, but this is the plan for what will be Firefox 3.

With OSS there's no marketing PR saying "We are going to release a product that does this", instead there is only the reality of what software development will produce. If you feel that strongly about the problem, you can lend a hand (you don't have to be a programmer, just search their bug report page for a problem and join the discussion, or if you're having a new problem, report that and make people aware), or sit back and hope for the best. If you have a better plan than what they came up with, then join Mozilla, or fork (that means take the source code as of now and start your own custom build) the project and do it better with your organization or even by yourself if you think you can do it.