Wednesday, April 15, 2009

Firefox Memory Hacks

Firefox is by far the most popular browser today because it is fast and provides ample amount of options.

But we can enhance the Speed and reduce the Memory Consumption by using some smart tricks. While performance is generally good for single – page browsing but when loading multiple tabs (> 10 ) with loads of supporting content like large images, huge number of thumbnails and other such things , the speed reduces considerably and the Memory consumption abnormally grows up.

In this section we'll try to reduce the memory consumption in such cases primarily by adjusting and changing key hidden preferences.

A Note: While these hacks may reduce your memory consumption a lot and hence help in speeding up the machine but they are certainly away from Industry Standards.

Reducing RAM Usage.

You might have noticed that when Firefox is minimized or not used for a long time then it's memory Consumption doesn't reduce, in fact it increases (at times by huge amounts).

On Windows, when a program is minimized and not used for long time then Windows swaps out the RAM memory used onto the disk, so that other program might use RAM. But Firefox, by default, doesn't allow Windows to swap it out and hence the memory consumption increases.

Now we can reduce the RAM usage by performing following steps –

  • Open a new tab in the Firefox and type "about:config" , without quotes, and hit enter. A huge list will appear.
  • Now Right – Click and then select New -> Boolean.
  • Type "config.trim_on_minimize" and press enter. Then in the new window that appears select "true".
  • Restart the Browser.


Setting the value of "config.trim_on_minimize" to true allows Windows to swap out the memory when the program is minimized.

Check out the Difference! It is quite large.

Play with Cache Memory

1. Firefox utilises a cache memory to store certain visual items like images, thumbnails etc. so as to enhance the speed.

Now open a new tab in Firefox and type "about:cache" in it and hit enter. You will see a page describing the memory and disk cache statistics. Click on "List Cache Entries" link in the "Memory cache device" section and you will see all the images caches and their details.

Now you can change the value of both Memory Cache and Disk cache according to your need.

Want to Save Memory or Increase Speed ?

Following table gives the default memory allocation –

Installed Ram(MB)

Automatic Cache Allocation(MB)

32

2

64

4

128

8

256

14

512

22

1024

32

2048

44

4096

58


Now if you want to increase speed, then enhance the Amount of Memory and if you want to save memory then reduce the amount of memory. You can change the memory by performing following steps -

  • Open a new tab in the Firefox and type "about:config" , without quotes, and hit enter. A huge list will appear.
  • Now Right – Click and then select New -> Integer.
  • Type "browse.cache.memory.capacity" and press enter. Then in the new window that appears , type the desired value in Kilo Bytes (e.g set it 32768 which is equivalent to 32MB )
  • Restart the Browse

  • Warning - Don't Increase it too much, else it might result in some unexpected results!

    In a way exactly similar to Memory Cache Capacity, we have Disk Cache Capacity and you can modify that too by the same process as above.

    Just change "browser.cache.memory.capacity" to "browser.cache.disk.capacity" in the second step.Although it is better not to change it, as it has no real affect on speed and as well as RAM memory consumption.

    Note: For the above two to work, make sure that "browser.cache.memory.enable" is set to true.

    2.Well, if you are really short of memory and are ready to sacrifice a SMALL amount of speed for it , then following two hacks will prove quite useful –

    Perform the Following steps -

    • Open a new tab in the Firefox and type "about:config", without quotes, and hit enter. A huge list will appear.
    • Now Right – Click and then select New -> Boolean.
    • Type "browser.cache.memory.enable" and press enter. Then in the new window that appears select "false".
    • Restart the Browser.

    After doing the above steps Firefox won't store decoded images, chrome (application user interface elements) and secure pages in memory.

    Now Feel the Difference in Memory Consumption!

    3.Now the Final Hack of this post. Perform the Following steps –

    • Open a new tab in the Firefox and type "about:config", without quotes, and hit enter. A huge list will appear.
    • Now Right – Click and then select New -> Integer.

    • Type "browser.sessionhistory.max_total_viewers" and press enter. Then in the new window that appears put 0.
    • Restart the Browser.

    While using internet, Firefox caches your previous pages to make your internet browsing faster. But in some cases this is just complete waste of memory. After above hack Firefox won't cache your previous pages.

    Note: It DOESN'T save a very large amount of memory and reduces speed by a whisker, so worth if you don't have a large RAM.

    Hope you enjoy the hacks and utilize them to the best possible extent.

    No comments:

    Post a Comment