Saturday, October 11, 2008

Firefox too slow to load? Consumes too much memory? How to reduce FF3 load time and memory consumption

Here are some great tweaks that I found on the internet to dramatically reduce FF3 load time and control that nagging sudden 'revving' of firefox, when out of nowhere it starts hogging RAM.

Here's the terrible situation that I was in, before implementing these tweaks:
1. A disappointed former fan of Firefox - I was promised heaven, but could never see it unfold beyond a point.
2. Would avoid using firefox and use opera instead, wherever possible. The slow load time and frequent hanging of FF3 were frustrating!
3. Would only use firefox when I absolutely needed to - like on bank websites (I'm paranoid about security), or google sites (Opera is by far the best browser I've experienced, but is an 'unsupported browser' on google), to access my blog (I love Scribefire), or to read the news once a day (I love Live Bookmarks).

Honestly, all the browser juggling was getting a little frustrating. So I launched on a web search to find out what I could do about bringing the Fox back under the leash. And after a little searching, here are a few great config tweaks I found, which greatly brought down the load time as well as eliminated FF3's frequent 'revving' problem.

The sources are also mentioned above the quoted portions.

Taken from -

Sometimes I just feel that Firefox is such a memory hog. Once I start to open up a few extra tabs, it starts to slow down my whole system. Fortunately, you can do something about it. Here are simple tips and tricks to reduce firefox memory and cache consumption.

Tip 1: Reduce session history

browser.sessionhistory.max_entries determines the maximum number of pages in the browser’s session history, i.e. the
maximum number of URLs you can traverse purely through the Back/Forward buttons. The Default value is 50. We usually won’t surf more than 5 of the websites we previously surfed before, and there is really no need to store more than that in the session which can clog up memory as they grow.
1. Open Firefox
2. Type about:config in the Firefox address bar
3. Press CTRL-F and search for browser.sessionhistory.max_entries
4. Double click on the value 50 (or whatever value is there currently) and change it to something lower such as 5.
5. Restart Firefox.

For Firefox 1.5 and above, you can also look at another configuration variable browser. sessionhistory. max_total_viewers

which also determines the maximum number of content viewers to cache for “bfcache” (fast back/forward navigation). Default value is -1 (calculate based on available memory).

Set it to 0 so that no pages will be stored in memory.
set it to a number such as 5 to store only 5 pages in memory.
more info here

Tip 2: Reduce memory usage when minimize

1. Start up Firefox
2. Type in about:config in the address bar and hit Enter
3. Right click and choose New > Boolean
4. Type config.trim_on_minimize in the pop-up box and hit Enter
5. Select True and hit Enter.
6. Restart Firefox

Tip 3: Fixed cache capacity OR Disable Cache Totally

Every time new page is loaded, Firefox will cache the page so it doesn’t need to load again to be redisplayed. By default, this setting is set to -1 for browser.cache.memory.capacity and to a number you specified in Tools -> Options -> Advanced -> Network / Cache for browser.cache.disk.capacity

To fix your cache to a certain value:

*browser.cache.memory.enable and browser.cache.disk.enable needs to be True for this to work

1. Start up Firefox
2. Type about:config in the address bar and hit Enter
3. Search for browser.cache.memory.capacity and set a number in KB to use for the memory cache (ie. 1024KB = 1MB).
4. Search for browser.cache.disk.capacity and set a number in KB to use for the disk cache (ie. 1024KB = 1MB).

To Disable the cache Totally

Set both browser.cache.memory.capacity and browser.cache.disk.capacity to 0.
Alternatively, you can also set browser.cache.disk.enable and browser.cache.memory.enable to False.

Tip 4: Use less extension and themes

This is really a no brainer. Uninstall all firefox extensions and themes that you don’t use as they can cause Firefox to use more RAM. If you think that you might still need the extension in future but not using it currently, at least there’s an option to Disable it. Use only extensions that you usually use to cut down memory usage.

Always upgrade your extensions and themes to the latest version as they may fix the some problems leading to memory leaks. Firefox makes this quit easy as it now does the checking for you, all you need is to do is tick some checkboxes and your plugins and themes wil be updated.

Tip 5: Check Firefox Memory Usage

Type about:cache?device=memory in the address bar and hit Enter. Firefox will display your current number of entries, maximum storage size, storage in use and inactive storage.

Taken from-

13) Limit RAM usage. If Firefox takes up too much

memory on your computer, you can limit the amount of RAM it is allowed to us. Again, go to about:config, filter “browser.cache” and select “browser.cache.disk.capacity”. It’s set to 50000, but you can lower it, depending on how much memory you have. Try 15000 if you have between 512MB and 1GB ram.

14) Reduce RAM usage further for when Firefox is minimized.

This setting will move Firefox to your hard drive when you minimize it, taking up much less memory. And there is no noticeable difference in speed when you restore Firefox, so it’s definitely worth a go. Again, go to about:config, right-click anywhere and select New-> Boolean. Name it “config.trim_on_minimize” and set it to TRUE. You have to restart Firefox for these settings to take effect.

Another tip - this one from me:

Stop using the Bookmarks Toolbar! If you are an avid RSS fan and have more than 6-7 feeds on your Bookmarks Toolbar, FF3 seems to consume 30-40 KB of RAM each time it updates the feeds.

Instead, I use an FF plug-in called 'Brief', which is an RSS reader that seamlessly integrates with Firefox. Once you have Brief installed, go to 'Bookmarks -> Organise Bookmarks' and create a new folder under your bookmarks menu. Give it any name you want. Then move all your live bookmark feeds into this new folder. You can then go to the settings option of Brief, and select this new folder as the source for its RSS feeds. And that's it. Thereafter, clicking on the Brief button brings up a separate, elegant tab on which your RSS feeds can be read in a variety of ways. And importantly, you can set Brief to update your RSS feeds according to a frequency that does not disturb your other work. I've set mine to update feeds once every 4 hours.

There you have it. After implementing these tweaks, my FF3 is ready for action on start inside 150 seconds, and has not hung since.

Happy browsing!

No comments: