Light a flame under Firefox's memory usage

Much the anti-thesis of my “I hate IE” post, I love Firefox. From principle to practice, it just is what a browser should be.

That said, one of the things that’s been bugging me lately about Firefox is that it is just crap on resources. I admit, I’m terrible with having 19 trillion tabs open at the same time, and that’s bound to slow stuff down. But, what I don’t like is that even after those tabs are closed and I’m back down to me and Google’s minimalism, Firefox can still be tipping the scales at 150+ MB of RAM.

Firefox is too fat

Hunting around a bit I found an excellent little post that explains how to stop this memory vacuum from getting away from you.

  1. Simply type about:config in your browser’s address bar.
  2. On the resulting screen, right-click and select New -> Boolean.
  3. In the input box that appears, type config.trim_on_minimize. Press enter.
  4. Select True, and hit enter.

What this does is causes Firefox to dump to your hard drive when you minimize it. Upon re-maximization, it loads back into RAM, but at a fraction of the bloated size it was. As an example, I just checked Firefox’s memory usage. With three tabs open, I was sitting around 80 MB of RAM being used. On minimization, this immediately dropped to under 10 MB. The upon maximization, it went up to 40 MB or so.

As I often have a lot of application open at once, the ability to control their memory usage like this is fantastic. If you use Thunderbird as your mail program, you can make the exact same modification. To get into the About Config, simply navigate to Tools / Options / Advanced / Config Editor.

Firefox is too slow

If you’re on high speed Internet, you’re also going to want to consider this little speed-up trick. By default Firefox is set to only download pages to your browser with four simultaneous connections. This is alright if you’re on dial-up, but broadband can handle a lot more than that.

  1. Again type about:config in your browser’s address bar.
  2. On the config page, look for these three entries: network.http.pipelining, network.http.proxy.pipelining, and network.http.pipelining.maxrequests.
  3. Change network.http.pipelining and network.http.proxy.pipelining to True.
  4. Change network.http.pipelining.maxrequests to a higher number based on your net speed – somewhere between 10 and 30 ought to do it.
  5. As a final step, right-click the screen and select New-> Integer. Name it nglayout.initialpaint.delay and set its value to “0”. This sets the amount of time the browser sits on its ass before acting.

See the original article at Forever Geek. And if you are using IE, bang your head against your desk five times and then check out this video for a solution just for you.

And finally, if that’s not enough – check out this nifty tool for tuning up Firefox. Appropriately named FireTune, the free application from Totalidea Software tunes up Firefox to work faster (very likely by implementing some of the above).

Clocking the results

So to test if any of these tweaks did anything but make me feel like it should be going faster – I put it through the Stopwatch – a neat little Web app that clocks a site’s load time. The results?

9.0s – With original (non-modified) setup.
8.2s – After FireTune automatic tweak.
9.3s – After the Forever Geek mod (faster, huh?).
7.0s – Combination of the FireTune and Forever Geek mod.

Now, it should be noted, that as I’m located in China, my load times are going to be a bit slower due to sheer distance in accessing most (US-based) sites. Whatever the case, a 1 to 2 second improvement isn’t much to e-mail home about.

Let me know if you have any tricks or tips that you find improve your Firefox or browser experience.

67 thoughts on Light a flame under Firefox's memory usage

  1. Good question. There’s likely a very well thought out reason for it… like they forgot or something…

  2. Hey, thanks very much for posting this–firefox, as much as I love it, has been a huge hog on my system resources (mostly because I love it so much, and have like 30 tabs open at a time). Now it’s all fixed.

  3. I love Firefox too, and it’s definitely my browser of choice on Windows. Unfortunately, I do all of my home computing on my Mac, and man does the Mac version of Firefox suck. It’s even more resource-hungry than the Windows version, or seems to be, and all of the add-ons and plugins in the world can’t make it look good next to the zippy delightfulness of Safari. The new Firefox 3 alpha seems to be running significantly faster, so maybe they’ve finally done something to speed things up — like taking out all the ‘debug’ code, or toggling that pesky ‘com.mozilla.leak_memory_everywhere’ variable to ‘0’.

  4. using the trim_on_minimize config option only changes the temporary allocation of memory, firefox still holds on to it’s original memory footprint. to see this, open task manager and select view -> select columns -> and check the VM size option.

    this will show you how much memopry firefox takes up in virtual memory, which you will see doesn’t change too much with the trim config option

  5. Firefox 3 addresses the issues of memory usage, and upon doing a memory test they devised (by opening 10 tabs if i recall, then opening more and closing the oldest ones, loading up various pages) it turned out that the peak memory for firefox 3 beta 4 was lower than the base memory for firefox 2. [there’s a graph of this]. Furthermore, IE was just off the scale, gave no memory back, at all, ever. But thats hardly surprising!
    Check it out.
    PAz

  6. The memory vacuum did do anything for my. Looking at the memory used in taskmanager (Vista Home Ulitmate), it looks the same whether maximized or minimized.

  7. The memory leaking is fixed more or less in Firefox 3, as said before, Try the latest beta of it, it’s apparently more stable than Firefox 2 anyway 😉

  8. Pingback: Best of Open Source and Social Media: Speed up little Firefox, speed up.
  9. Wow, someone lit a fire under this post – cheers OpenJason for the link, and for whomever Stumbled it. And yup, you’re all absolutely right – the virtual memory doesn’t change. In my opinion though, it is better to have more usable “real” memory than virtual memory. The logic being that it takes longer to access information from a physical hard disc where virtual memory is stored, over the rather instantaneous speed of RAM chips.

    That said, I believe this will only show a real plus for the usage of small programs that don’t require large amounts of virtual memory and can just fill in the vacuum left by Firefox in the RAM. If you’re using other large programs, you’re likely to still be having problems.

    @PAz: I’ve been testing FF3 for a while now – am quite happy with the results – actually the major reason I’ve not posted an update about this post (it’s a tad old now).

  10. Does it hurt when Bill Gates rams it in? Just asking since you obviously worship the ground he walks on.

  11. Having nglayout.initialpaint.delay set to 0 may not help in the way you think. Set to zero, as soon as data is received it starts trying to draw the page, but setting it to a small amount allows some more time for data to be received (at a faster rate because it’s not also busy drawing) before starting to render the page.

    Zero is a waste in any case, because 0ms after you click a link there’s no way there’ll be anything to render.

  12. @Eric: What are you on about m8? I don’t think anyone around these parts is any sort of MS fan.

  13. I’ve downloaded and saved firetune, once it’d installed i tried to launch it and an error message popped up saying;

    FireTune Main Executable has stopped working.

    Any ideas on how to overcome this?

    Cheers

  14. Thanks PGB. I realized what a numb skull mistake I made. Thanks for not razzing me.

  15. I aswell as doing what you suggested (thanks for that btw), I use ‘FasterFox’, and a little known program called ‘Firefox Ultimate Optimizer’ from this site – felipex.net ( but it aint loading for me at mo so search “Firefox Ultimate Optimizer”
    1 other program I find speeds FireFox up is.. ‘FireTune’ from this site – http://www.totalidea.com/content/firetune/firetune-down.php

    Hope they help you all, All the best, Jay1971Jay

    http://jay1971jay.stumbleupon.com/

  16. In response to “Why isn’t this enabled by default?” this may have something to do with it: From High Performance Web Sites from O’Reilly- “The explanation goes back to the HTTP/1.1 specification, which suggests that browsers download two components in parallel.[this is per host name]” This is the default behavior for Firefox when it’s downloading HTTP/1.1 pages. Interestingly the Firefox default for HTTP/1.0 pages is 8 concurrent downloads. It says that research at Yahoo! suggested that 4 concurrent connections resulted in the best user experience, but that was compared to 2,8, or 20 and was taking into consideration Yahoo!’s bandwidth.

  17. Is it just a stupid question, or does anyone else know about the
    “browser.cache.memory.capacity” integer to limit the memory useage of Firefox? This has seriously left my laptop with alot more fre memory after I limited it to 16MB I think it was

  18. @ Lewis england
    My “browser.cache.memory.capacity” is at default and looks like this…
    “browser.cache.memory.capacity UserSet Integer 65536”

    Should/Can I change anything to speed things up??

  19. @Jay
    Your value seems very high!
    changing the integer depends on the amount of memory in your system. Lowering this will use less system memory and so firefox will work smoother.
    Here is a table of good values for Firefox 2

    Physical RAM Memory Cache (in KB)
    32 MB 2048
    64 MB 4096
    128 MB 6144
    256 MB 10240
    512 MB 14336
    1 GB 18432
    2 GB 24576
    4 GB 30720
    8 GB + 32768

  20. That last post went so wrong.
    you can probably tell what the ‘table’ says. Basically, the number before the “MB” or “GB” is the system memory, the number afterwards is basically the number that you enter as the integer value

    Hope this helps.

  21. @ Lewis England

    Im not too good with computers so hope I’m looking at the right thing here. I hit the start button (in Vista) then right-clicked computer and sellected Properties, it shows that I have….
    ‘Memory (Ram) – 1022mb’
    Should I set my integer value too 18432 ??

    Appreciate your help Lewis, All the best, Jay

  22. Looks like memory leaking is fixed well in FF3. I’m using it at the moment, and I have got no problems at all…

  23. I tried to do this with the new FF 3 beta 5 and it comes up with a screen that has all the add on, extensions, etc. I cannot put in a new boolean integer on this site. Any suggestions?

  24. Awesome post! I’m going to try your tips. FF always seems to slow my system down a little now maybe this will help.

  25. Is this item Windows-only?
    The memory-to-hard drive config does nothing in Linux’s swap-file or memory usage.
    As for Thunderbird in Linux, no “Tools / Options /” menu item exists.

  26. Great site Excellent Article . I will give fine tune a try and review it on my website. Keep up the good work. this blog should be on Entrecard, you would benefit immensely from the exposure.

  27. Like many people here I love Firefox and many of its great extensions, but yes, it hogs resources. I’m hoping these tweaks will help make it work better.

    But no matter – Firefox is great anyway, warts and all.

  28. I suggest people look for enigma browser and download it from http://store.democratz.org

    You can find the link just above the products and you can download it for free.

    Engima runs faster than Firefox and you can easily run 32 tabs and not slow down the machine.

  29. Made no difference at all. No steps are missing like which line to right click on? Ron

  30. Ron, you dont right click on any particluar line, but just in the general empty space there on the page, then select Boolean, and then paste the value into the field.

    great bit of info here, definitely has made an improvement with my FF speed.

    thanks

  31. Hi Ryan: You have me to thank for re-lighting this little fire you lit in September. Unfortunately, my problem is I have a Intel celeron D processor and it just sounds like a wind tunnel when I have my FF 3 beta 5 up because of all the add ons I’ve been using. I don’t think you can do this light the fire with this verson of FF but if there are others that like to use the older versons. it sounds like they may be benefiting from this. I have a question maybe you can help, I cannot download the Windows Installer. Everytime I go to install something I get this message that “Installer cannot be accesssed. This may be due to installer being installer incorrectly or being used in safe mode”. I’ve tried everything that their site recommends, all the blogs, etc. Just doesn’t want to work. I cannot install any new software. This is a Windows thing, i know, but any suggestions. I tried unreg and re-reg, which seems to be the answer to alot of others with this problem, but not my answer. I tried downloading through SDK platform, & it won’t do it through there or through safemode. It seems to me that some of the files may not be in their suspect pathway, but not sure where they should be. ANY suggestions would be appreciated. Thanks, Susie

  32. Hey Susie, I wish I could be more help, but I’ve not seen the error before. If the MS site was no help, and ditto google/blogs/forums, I would start looking long and hard for a virus or malware of some sort, as when things go goofy and all else fails, it’s often the culprit.

  33. Hi Ryan:

    Sorry about the heckler above. I appreciate you taking the time to respond. I have run all my virus programs and haven’t found one! It will get figured out when it gets figured out! Thanks again, Susie

  34. cheerz M8 My firefox work alot better and is alot more effeiciant!

    Epic!!!!!

  35. Very Nice! before applying those steps my firefox was eating 104,384 from my RAM even when minimizing it, now active 29K & 7K when minimized.

  36. To Susie: look for Windows Installer Cleanup prog from Microsoft site. Worked for me. Good luck.

  37. Thanks for your input. I’ve tried it. It still gives the same error msg, that the windows installer could not be accessed either because it was installed improperly or it is operating in safe mode. So, while on the MS site I found the error listed that I keep getting. I have to check that the Msiexec.dll file is under C:WindowsSystem32 and then locate (where the matching registry key is (the server must contain the right file C:WindowsSystemMsiexec.exe/V), and then register it in safe mode. The problem is that I have too many of the first file in several locations so I am wondering if I deleted them and just left the one in System32, (one of them is an uninstall file) and then tried to register the server. If that doesn’t work, i will jump off the bridge, everything I’ve tried to do is tied up with this windows installer not being in the right place. I cannot download anything because the installer itself is malfunctioning. It’s like a catch 22. Any ideas? Thanks, Susie

  38. Pingback: Draco Inc. » Blog Archives » huge dump
  39. I noticed that quite a few people are stating that they have not seen any changes, and that you don’t mention restarting Firefox after editing about:config. I found that the ‘Firefox is to Fat’ tip worked beautifully … but only after I restarted Firefox after having made the changes, then the memory size is reduced when Firefox is minimized.

  40. Generally, I appreciate your helpful comments. However, your suggestion about nglayout.initialpaint.delay is specious. Your suggestion will delay page rendering: the exact opposite of your intent. The reason is 0 delay causes Firefox to waste resources trying to render before Firefox has received sufficient data to render productively. Thus, rather then waiting for date to accumulate, then rendering efficiently, Firefax squanders resources by trying to render without data. Your suggestion is like asking a bucket brigade to save time by neglecting to fill the bucket.

    For a concise summary of this phenomena, please see:
    http://kb.mozillazine.org/Nglayout.initialpaint.delay

    For more detailed discussion, please see:
    https://bugzilla.mozilla.org/show_bug.cgi?id=180241

    Please persist in your good work and helpful suggestions, but for this one, maybe you should edit your advice.

    Also, with respect to minimizing Firefox to disk, perhaps you should warn readers that your suggestion may substantially slow restoration of minimized Firefox window.

    Your suggestion does not reduce Firefox memory usage, but rather allows Windows OS to swap minimized Firefox window from RAM to disk. This swap allows minimized window to repose on disk beyond actual RAM, but at the cost of delayed restoration.

    Some of your pipelining suggestions are current Firefox defaults. Also, maybe you should advise that increasing max requests may help fast connections, but may confound slow connections.

  41. Hehe, nice…. Guys, if I have a 1.2Gb of memory, What´s the number i should use??

    in browser.cache.disk.capacity i have (by default) 50000

    Thanks in advance. 😛

  42. Hehe , thanks my friend… Buuuuuuut… i don´t have this command line.. browser.cache.memory.capacity (nop i searched and nop..) the only one i have is browser.cache.disk.capacity

    yep, i´m lost here… should I create it?, and if it´s not too much to ask.. can you post the parameter for that command line?

    Hehehe, sooorry for the trouble.. and Thanks (again) hehe..

  43. Hehe, I think i finally figure it out.. 😛

    Type: integer, Name: browser.cache.memory.capacity, Val: 20000

    Thanks.

  44. when i did the tips listed and installed FireTune firefox will no linger let me use the back buttes or the refresh or stop. the menu bar above that is also gray and it wont let me select anything there. i have fire for 3. on each new tab the little circle thing does not stop going.

  45. on and btw my bookmarks are gone and it wont let me add new ones and the url bar never shows anything after i hit search.
    hope you can help

  46. A Quick update, as far as I know all versions of firefox that have / will be produced will work with the “browser.cache.memory.capacity” integer. REMEMBER, as i have just read DS’ post, that it is not there yet, you have to create it by right clicking, new > Integer. first box copy and paste
    browser.cache.memory.capacity
    in, next bosx is the value from the table above.
    You have to restart firefox to activate this. This goes well with the Pipelining set to around 30 as it sends the requests but does not suck up the RAM.

  47. Since I have Fireffox I cannot change anything nor erase sender’s name on e-mails received, which does not allow me to forward any m ail. How can I eliminate this problem?

  48. Unfortunately none of the above will work for latest versions of both SeaMonkey2a and Firefox3.0.7

    mt

  49. I have done that suggestion at the top long ago. Some sites hog the processor and the browser uses a lot of memory too. Over 600,000 some times with one or two pages open. I in the windows task manager on the processes tab set the priority at below normal. It does not stay there but it forces it to be less demanding and I notice no slow down in anything. What I do notice is processor use never gets near 100% then. I do not trust anything to do with information collecting google and will not use chrome. I honestly do think what makes it slow is the sites visited. I also frequently delete all cookies when it slows down.

  50. I tried the memory usage one, having FF open with 7 tabs was 130mb I closed 2 tabs and minmined and it only went down by 1mb. it doesnt seem to work too well for me.

Say something...

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Return to Top ▲Return to Top ▲