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.

Filed under: Internet, Miscellaneous | | Written on September 7, 2007

63 Comments »

Comment by
fiLi

Why isn’t the first one enabled by default? :S

September 15, 2007 @ 7:48 pm

Comment by
Ryan

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

September 15, 2007 @ 8:05 pm

Comment by
kmm

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.

September 22, 2007 @ 12:45 pm

Comment by
Brendan

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′.

December 1, 2007 @ 7:48 pm

Comment by
doug m

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

April 1, 2008 @ 12:55 am

Comment by
PAz

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

April 1, 2008 @ 1:08 am

Comment by
Keith

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.

April 1, 2008 @ 1:26 am

Comment by
Darkfrost

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 ;)

April 1, 2008 @ 6:42 am

[...] Speed up little Firefox, speed up. Posted by Jason March 31, 2008 Sourced from: Light a flame under Firefox’s memory usage | Dao By Design Blog [...]

April 1, 2008 @ 7:18 am

Comment by
Ryan

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).

April 1, 2008 @ 10:25 am

Comment by
Eric

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

April 2, 2008 @ 5:10 am

Comment by
Matt`

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.

April 2, 2008 @ 6:33 am

Comment by
Ryan

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

April 2, 2008 @ 8:03 am

Comment by
stu

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

April 3, 2008 @ 4:37 am

Comment by
Scott

When I enter about.config I get http://www.about.config/ how can I fix that?

April 3, 2008 @ 10:34 pm

Comment by
PGB

Scott, make sure you enter about:config not about.config and it should work

April 4, 2008 @ 2:18 am

Comment by
Scott

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

April 4, 2008 @ 2:57 am

Comment by
Jay

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/

April 4, 2008 @ 5:32 am

Comment by
Jay

Firefox Ultimate Optimizer
1.1 I found for you on this site….

http://firefox-ultimate-optimizer.en.softonic.com/

All the best guys ‘n’ girls. Jay

http://jay1971jay.stumbleupon.com/

April 4, 2008 @ 5:35 am

Comment by
bnourse

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.

April 4, 2008 @ 6:47 am

Comment by
Lewis England

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

April 4, 2008 @ 8:18 pm

Comment by
Matt Ellsworth

nice post – stumbled here as well – as a lot of others it seems… ff3 is definately better at memory than ff2

April 4, 2008 @ 10:19 pm

Comment by
Jay

@ 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??

April 5, 2008 @ 3:54 am

Comment by
Lewis England

@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

April 5, 2008 @ 4:59 am

Comment by
Lewis England

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.

April 5, 2008 @ 5:05 am

Comment by
Jay

@ 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

April 5, 2008 @ 7:42 am

Comment by
Joe

Use the new FF3 Beta. Most major plug ins already work for it.

April 5, 2008 @ 1:29 pm

Comment by
Lewis England

@ Jay
yes, thats the right value. Good luck with that

April 5, 2008 @ 4:25 pm

Comment by
Muzicar

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

April 5, 2008 @ 4:27 pm

Comment by
Susie

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?

April 6, 2008 @ 8:28 am

Comment by
Jay

@ Lewis England

**DONE!!**

Thank you matey, I got there in the end :)

April 7, 2008 @ 6:20 am

Comment by
Justin

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

April 9, 2008 @ 4:00 am

Comment by
Steve

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.

April 9, 2008 @ 8:29 am

Comment by
Alfred Saforo

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.

April 9, 2008 @ 7:21 pm

Comment by
Chiron613

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.

April 10, 2008 @ 4:15 am

Comment by
enigma

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.

April 10, 2008 @ 1:34 pm

Comment by
Ron

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

April 13, 2008 @ 10:18 am

Comment by
UK Si

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

April 15, 2008 @ 3:05 am

Comment by
Ron

THANKS! I’ll give it another try. Ron

April 15, 2008 @ 3:21 am

Comment by
Susie

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

April 15, 2008 @ 11:12 pm

Comment by
Ryan

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.

April 15, 2008 @ 11:57 pm

Comment by
Yasin

Thanks a lot

April 17, 2008 @ 3:33 am

Comment by
Susie

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

April 18, 2008 @ 8:12 am

Comment by
Dennis

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

Epic!!!!!

April 19, 2008 @ 2:52 am

Comment by
Abdulateef

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.

April 20, 2008 @ 2:03 am

Comment by
Norvell

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

April 21, 2008 @ 12:20 am

Comment by
Susie

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:\Windows\System32 and then locate (where the matching registry key is (the server must contain the right file C:\Windows\System\Msiexec.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

April 21, 2008 @ 4:25 am

[...] overclock firefox (pipelining AND more!) [...]

April 21, 2008 @ 3:03 pm

Comment by
Nilo

if u r using firefox 3 beta what to u mean by ”the screen”?

April 21, 2008 @ 7:15 pm

Comment by
Roland

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.

April 22, 2008 @ 7:34 am

Comment by
WindSweptCowboy

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.

April 26, 2008 @ 11:20 pm

Comment by
DS

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. :P

May 8, 2008 @ 8:48 am

Comment by
Lewis England

If you’re talking about “browser.cache.memory.capacity”, then you should use something like 20000

May 12, 2008 @ 6:51 am

Comment by
DS

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..

May 12, 2008 @ 7:47 am

Comment by
DS

Hehe, I think i finally figure it out.. :P

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

Thanks.

May 12, 2008 @ 7:57 am

Comment by
swapy

Awesome post!thanx a lot..

June 16, 2008 @ 10:52 am

Comment by
tyler

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.

July 10, 2008 @ 7:39 am

Comment by
tyler

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

July 10, 2008 @ 7:41 am

Thanks a lot for this write up on Firefox

Especially those memory saving tips ……….

December 11, 2008 @ 7:40 pm

Comment by
Lewis England

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.

December 18, 2008 @ 3:54 am

Comment by
Marie de Peic

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?

February 5, 2009 @ 11:26 pm

Comment by
Michael

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

mt

March 18, 2009 @ 5:57 pm

Comment by
mobiliario

fabrica sofas fabrica mobiliario

January 24, 2010 @ 8:48 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

PIGEONholed

RECENTLYspoken

  • Matt Said: @Ralph You can use the alpha transparency filter in your style sheet to fix your png problem in IE. Not...
  • jack Said: thanks helped a lot
  • Acez Said: I was having he same problem. Improved it using your tutorial.very helpful!! thanks
  • Media Street Said: Thanks for that. Just added it to my Joomla! site.
  • Ed Said: @bonz there is a timestamp in WP that identifies the times and classifies them as new, newer and newest.

BLOGroll

PASTposts

BADGEpatch

Blog Directory - Blogged Internet Blogs - BlogCatalog Blog Directory
Copyright © 2008 Dao By Design, All Rights Reserved.