Firefox's Memory Leak Bug or a Feature ?

Back when Firefox was a 1.0 "baby" application, many tech. enthusiasts started adopting it and proclaimed it as the future of web browsing. However, ever since it reached a certain version (namely, version 1.5) there has been a continuous rumor of it having memory leak problems.

Thousands of users and bloggers reported that after a certain amount of time Firefox starts to consume too much memory, therefore paving the way for the rumor-mill. Even I have caught Firefox consuming an amount of memory close to the 100 megabytes, however I never considered it a problem because think that I instinctively assumed that it had something to do with the browser's cache, and that's exactly what the "problem" is.

An unknown blogger from the element14 wordpress blog explains:

This ‘feature’ is how the pages are cached in a tabbed environment. To improve performance when navigating (studies show that 39% of all page navigations are renavigations to pages visited less than 10 pages ago, usually using the back button), Firefox 1.5 implements a Back-Forward cache that retains the rendered document for the last five session history entries for each tab. This is a lot of data. If you have a lot of tabs, Firefox’s memory usage can climb dramatically. It’s a trade-off. What you get out of it is faster performance as you navigate the web.

Ok. So now that we know that it's a feature, how can we change Firefox's settings so it won't eat up so much memory? Easy:

1. type “about:config” (no quotes) in the browser.
2. Find browser.sessionhistory.max_total_viewer
2. set it’s value to “0″

There's also a little hack you can do so that Firefox only consumes 10mb of memory when it's minimized [discussed earlier by us somewhere]:

1. Open Firefox and go to the Address Bar. Type in about:config and then press Enter.
2. Right Click in the page and select New -> Boolean.
3. In the box that pops up enter config.trim_on_minimize. Press Enter.
4. Now select True and then press Enter.
5. Restart Firefox.

So there you have it, the Myth Busters *cough* I mean, element14 helps to debunk this myth about the alleged Firefox Memory Bug. And there's also another tweak there to help you increase Firefox's speed in loading pages (although, it isn't very noticeable with DSL connections).

I am sure most Firefox power-users have seen the optimized builds for the various operating systems. It is also possible to make changes that will increase performance yourself using the about:config panel.

Basically just run Firefox, type about:config in the address bar and use this page as a guide for what you can change for your specific situation (fast computer/slow connection, slow computer/fast connection, etc.).

For an additional reference, check out the Firefox Tweak Guide

1 comment:

James said...

Man, that's an awful, awful way to fix what is a completely insane default behaviour. My firefox currently is using 377MB of RAM. Who on earth thought that a "feature" that is observationally equivalent to a really nasty memory leak was a good idea to enable by default, never mentioning it in the GUI preference menu, and having you change undocumented flags in the bloody config: registry to turn it off? Makes my head hurt to think about.