Firefox Memory Tweaks

Many users seem to have the feeling that the memory consumption of Firefox seems to get out of hand after a certain period of continued web browsing. It is however not that easy to determine the exact cause that seems to slow down Firefox after a while. I try to give some insights in possible solutions to those slow downs - they might help in some cases but could change nothing in others.

The first and most important aspect is to consider removing themes and extensions which can really consume lots of memory. Before you start removing extensions you should do the following to see if it is possible to determine which extension or theme is responsible for the memory consumption.

  • Starting Firefox in Safe-Mode
    • Safe-Mode disables all extensions and themes and loads Firefox with the default template. If this method uses continuously less memory a theme or extension is most likely responsible for the high memory consumption.
    • To run Firefox in safe-mode simply add the following parameter during startup "-safe-mode".
  • Problematic Extensions
    • Some extensions cause unwanted side effects. The Mozilla team is collecting information about those extensions which can be looked up here. You can try the suggested workarounds to fix the problem or uninstall the extension completely.

All the following tweaks can be achieved by typing in about:config in the Firefox address bar and entering (part of) the bolded parameter into the filter field.

  • Browser.cache.memory.capacity
    • Controls the maximum amount of memory to use for caching decoded images and chrome (application user interface elements).
    • This determines if and how much system ram Firefox will use to cache itself. The element does not exist and has to be created. The default value is set to automatic which means that Firefox uses a certain amount of RAM by default. (values for Firefox 2.x)
      • 32 MB of RAM -> 2 MB
      • 64 MB of RAM -> 4 MB
      • 128 MB of RAM -> 6 MB
      • 256 MB of RAM -> 10 MB
      • 512 MB of RAM -> 14 MB
      • 1024 MB of RAM -> 18 MB
      • 2048 MB of RAM -> 24 MB
      • 4096+ MB of RAM > 32+MB
    • You can set another value by creating the element in about:config and assigning a different value (in KB) to it. It is also possible to turn this feature off by assigning the value 0 to it. This can greatly decrease the performance of Firefox and is not advised at all.
    • To reduce memory consumption reduce the amount of RAM that is assigned to Firefox.
  • Browser.sessionhistory.max_entries
    • Firefox 2.x saves the last 50 visited websites of a single session in memory which means that it could add up quickly if you visit lots of content filled websites.
    • Reduce the amount of websites that are stored this way to reduce the memory consumption. It does not make a huge difference for most surfing habits to reduce the figure to 5 or 10.
  • Browser.sessionhistory.max_total_viewers
    • Automatically determine the maximum amount of pages to store in memory based on the total amount of RAM.
    • If you have 64 MB or Ram 1 page is stored in memory, 2 for 128 MB, 3 for 256 MB, 5 for 512 and 8 for everything higher than that figure.
    • If you never navigate using the Back and Forward buttons in Firefox you can set this value to 0 to disable the feature.
    • Otherwise reduce the amount of pages stored in memory to make this feature use less memory.
  • Config.trim_on_minimize
    • This preference determines whether to allow Windows to reclaim memory from a minimized Mozilla application.
    • Set to True if you want to free up memory when minimizing Firefox.
    • The value does not exist by default, simply create it and set it to true for better memory management.
Read also:  Firefox Focus 1.1 for Android released

Update: Mozilla has improved the browser's memory consumption significantly in newer versions. The preferences are however all still working.

 

Advertisement
Please share this article

Facebooktwittergoogle_plusredditlinkedinmail



Responses to Firefox Memory Tweaks

  1. Thinker February 26, 2007 at 11:58 am #

    not Config.trim on minimize
    but config.trim_on_minimize

  2. Andrew February 26, 2007 at 4:36 pm #

    It doesn't matter how you tweak it, Firefox is still slower: http://www.FirefoxMyths.com

    • Martin February 26, 2007 at 4:58 pm #

      There is more than one reason for not using Internet Explorer. It is also very difficulty to compare Firefox and Internet Explorer directly because of the different levels of integration in the operating system.

      If you want to compare them do so on a Mac for instance :) If there is IE 7 for Mac that is.

    • werdna April 27, 2015 at 10:00 am #

      I cant believe the sheer volume of crap on that site: all they do is push Microsoft products and ridicule open standards. Who would expend so much effort to trash Firefox and uphold Explorer like a sacred cow? When you talk to those bloggers who said that Microsoft tried to bribe them, the answer should be obvious: that site was probably constructed by a Public Relations firm, not by a kid named Andrew. Microsoft tried to destroy Firefox because it promoted open standards during a time when Microsoft ruled the web:

      "By 2000, IE had a 95% market share; it was the de facto industry standard, which meant that if you wanted to make a living from software development you had to make sure that your stuff worked in IE. The Explorer franchise was a monopoly on steroids."

      http://www.theguardian.com/global/2015/mar/22/web-browser-came-back-haunt-microsoft

      Notice how the mythical "Andrew K" attacks Mozilla's MARKET SHARE. The site is not really about the browser's performance: they are implying that you should continue to use Microsoft developer tools and proprietary web standards because nothing else is statistically relevant. When "Firefox Myths" was created, many banking web sites would only work with Explorer. The entire point of Explorer was to protect Microsoft's OS monopoly by monopolizing the web. Microsoft desperately wanted to kill Firefox in the cradle, but it had to be done through a proxy like "Andrew." We did not see a similar smear campaign against Chrome because Chrome did not appear until 2008. By this time Microsoft understood that it could not maintain a stranglehold on the internet by pushing propaganda and proprietary standards. And now everything has come full circle:

      While Microsoft tried to claim that Explorer has better performance, they are now retiring the browser because of its poor performance. Firefox has fulfilled its mission of liberating the web, but the more things change, the more they stay the same: The new Microsoft browser will only support Windows 10, because they want to force you to buy a new copy of Windows. And dont bother asking what happened to Windows 9. Microsoft has built its business on a fragile, bloated, underperforming OS. Now it has to defend that with propaganda and strong-arm mafia tactics because Windows is increasingly less appealing, regardless of how they change the user interface. But this is going to backfire too, because Windows users dont really need another browser from the people who gave us Explorer. And soon they will realize they dont need Windows either.

      http://www.kmfms.com/whatsbad.html

  3. Mosey February 26, 2007 at 6:34 pm #

    Great summary thanks :) I've only just started implementing a few of them so will see what happens. Hopefully it will reduce memory usage!

  4. liquid parallax February 26, 2007 at 10:16 pm #

    Martin's right. There is memory that is not solely used by IE that IE uses within the windows system. Some of the information is faulty or outdated on firefoxmyths.com, although it does give a different perspective than jumping on the non-Microsoft bandwagon.

  5. gnome February 27, 2007 at 10:12 pm #

    A life saver. Thanks!

  6. Jawad Rafique June 13, 2010 at 1:38 pm #

    Thanks a lot. After reading this I realize i was overloaded with Add-ons, I get of some and it has really made a great impact on memory utilized by firefox.

  7. Bienvenido David November 29, 2010 at 10:45 pm #

    Mozilla also recommends users to periodically restart Firefox if left open for long periods of time. Memory Restart is a Firefox plugin that makes this a snap. You can restart Firefox in one click if it reaches a certain memory threshold. You can download Memory Restart at https://addons.mozilla.org/en-US/firefox/addon/249361/.

  8. Logic March 27, 2011 at 1:14 pm #

    its asinine for everyone to always want their memory to be 80%-free and never utilize it for what you are actually doing on the computer, in this case firefox browsing.

    close to 100% of your memory filled with cache is GOOD, not bad. it makes things run super fast and load from RAM Cache. in linux, when 95+% of your memory is filled with cache everything works faster than a 600 dollar high tech SLC solid state drive.

    • Kriegar September 1, 2012 at 8:37 pm #

      This might actually be true-if it did not consume so much of the memory that it makes the system stutter...but, in fact, it does. Why? Most likely because it does not release memory that it is no longer using.

      That being the case, a memory cleaner of some sort is needed, and frankly, should be coded into the browser. Apparently, this is beyond the capabilities of those who code FireFox.

    • Westnile September 14, 2012 at 9:54 pm #

      @Logic your a complete moron wtg NOT everyone just browses with firefox only and does nothing else.

      A GOOD MAJORITY or people multitask and when firefox eats up everything they cant accomplish what their intending to do.

      So 100% cache usage is NOT good it eats up mem for say watching a video listening to music, playing a game where someone might minimize it rq to check something in a guide online or something.

      Think before you speak mr yoda because your just making a fool out of your self and acting like your a know it all, I've been in this field for 18 years and yet I don't go off like a know it all idiot like you so bluntly do.

  9. Logic March 27, 2011 at 1:18 pm #

    Next, Write an article about how it would be awesome to turn a 3.0 Ghz CPU down to 0.3 Ghz so that you only use 1/10th of your CPU. Then say its good.

  10. logicbuster July 9, 2012 at 12:30 am #

    lol who wants to dedicate 100% of your memory to firefox? i mean really? good luck running photoshop or a resource heavy program like a game along-side a browser hogging 100% of your memory...

Leave a Reply