Skip to comments.Fixing Firefox's memory leak (January, 2005)
Posted on 01/24/2005 3:04:40 PM PST by Terpfen
I noticed a few Firefox threads here have people complaining about how much memory Firefox takes up. This is a known memory leak, and the Mozilla guys haven't gotten around to fixing it for whatever reason. But there's no reason your Firefox should take up 70,000K in memory, so here's how to fix that memory leak and keep Firefox from bloating up.
1. Open a new tab. Type "about:config" without quotes into the address bar and hit enter/click Go.
2. Right-click anywhere, select New, then Integer. In the dialog prompt that appears, type:
3. Click OK. Another dialog prompt will appear. This is where you decide how much memory to allocate to Firefox. This depends on how much RAM your computer has, but generally you don't want to allocate too little (under 8MB), but if you allocate too much, you might as well not do this. A good recommended setting is 16MB. If you want 16MB, enter this value into the dialog prompt:
(Why 16384 instead of 16000? Because computers use base-12 counting. Thus 16 megabytes = 16384 bytes. Likewise, if you want to double that and allocate 32MB, you'd enter 32768.)
4. Click OK to close the dialog box, then close all instances of Firefox and restart. If your Firefox still uses the same amount of memory, give it a few minutes and it should slowly clear up. If that fails, try a system reboot.
Hope I did a service to some FReepers today.
Most helpful. Thanks.
>>>>Because computers use base-12 counting.
No, computers use binary.
Yeah, but memory allocation is still done in base-12, and that's what this thread's about.
What exactly do you mean?
What do you mean by what do I mean? *confused*
2^8 2^7 2^6 2^5 2^4 2^3 2^2 2^1 256 128 64 32 16 8 4 2
thus - 1MB = 1024 bytes = 2^10 and so on...
Odd, I was always under the impression that allocation uses base-12.
Ah well, thanks for the correction.
Sorry Terpfen, he is right. It's all based on binary. That is why on and off are represented on power keys with zero and one ( 0/1 ).
You might be thinking of hexadecimal... which is base 16.
I'll try it, see if it makes what's good better!
There are 10 kinds of people in the world - those who understand binary and those who don't.
There indeed are. (I know enough to get THAT joke.)
Doesn't hurt to give it a try, but I think all this is going to do is force Firefox to swap pages out to the page file. You may notice an increase in hard drive activity.
Firefox bump for later reference
Is there a problem with Firefox using 70 megs when you have 256? I haven't noticed any performance issues.
I've been using it for a while and don't hear or notice any additonal activity. YMMV, of course.
Generally, it's bad whenever a program chews up more memory than it needs. 70 out of 256 is pretty damn disproportionate, IMO.
I'm gonna give a shot. The virtual memory size has been hanging out at about 120MB. I set my memory limit to 24576, and will check see if the paged memory goes up.
I thought it was base 10 binary. (Of course, any base is base 10)
Why do geeks confuse Christmas and Halloween?
A: Because 31 OCT = 25 DEC
There is only browser.cache.memory.enable in my Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
I.e. no browser.cache.memory.capacity. Could someone advice?
You have to create the value yourself. Read the step again--it's an instruction as to how to create that value.
Not sure. Some people have the same problem. Maybe it's more of a "memory recommendation" than an actual limiter, which would make sense, especially if you have a lot of windows/tabs open constantly.
Word is Mozilla might have a fix ready for Firefox 1.1's release in June, but that's not set in stone.
I created the new entry, did a reboot and FF is still using over 27 Meg...same as before the reboot. I think I'll play with some smaller integers and see what happens.
Yes, the memory leak is still there. At the time of my posting this, these steps DID help to minimize and partially eliminate the memory leak. Changes to 1.5 make them less effective.
The best solution right now is to use config.trim_on_minimize.
Another useful tweak is to change the browser.sessionhistory.max total viewers value from -1 to 0. It disables caching of previous pages, which slows down backspacing slightly with broadband but I've noticed quite a bit less memory being used.
Also I keep config.trim_on_minimize set to false but I do have browser.cache.memory.enable on false as well. That seems to have helped somewhat.
It could be related to the extensions. Have you tried running it in safe mode for a while to see what kind of memory use you get?
I read someone's answer and tried it, the thing with the memory setting and the binary discussion. Well, it's true, it didn't work.
So, I decided, "Instead of being a lazy ass and looking for answers elsewhere, I'll simply go into the about:config and looked for myself."
Guess what? I got it right on the first shot out...
Here you go, THIS is what you need to change, VERY SIMPLE!
Find this line using the about:config in the URL = browser.cache.memory.enable
Click or double click on it so it reads: FALSE It should turn Bold also, to note the change.
I tried it, loaded up on as many pages as I could find and WHAMMO! Memory never exceeded my limits and dropped down to the 22k evertime a page would finally complete loading!!!
I now have about 10-20 forums to post this too because other people are still screaming about it.
Is this issue still unsolved.. i am seeing mozilla still leaks!!
This caused some odd behaviour when I tried it on my 18.104.22.168 install. The home botton and various links in my bookmarks toolbar ceased to work, although there did seem to be an improvement. Don't know if anybody else had the same issue.
2005: "Hope I did a service to some FReepers today."
2006: and even a year later you helped some none FReepers. See
"I know on the current Firefox, you can take measures [freerepublic.com / http://www.freerepublic.com/focus/f-bloggers/1327586/posts] to restrict its size but I think it starts to thrash when I go to a largely intensive Flash site. "
Firefox 2.0 RC3 Released
Yeah, this article ranks pretty high on search engine results lists. I'm amazed. Thanks for the notice!
You're welcome. That about:config is handy to keep as reference and use. I am using 2.0 now, BTW. Had to remove some extensions at first.
And tell those same people that Firefox 3 is slated to fix a whole host of memory leaks, partially due to its codebase getting a fairly extensive reworking.
I installed a free Freememory program. It seems to have helped. Also if click the "-" hide the page/browser button at the top right it refreshes FireFox.
The Firefox memory issues may have little to do with Firefox itself, at least in some cases. I found the culprit was actually the popular Zone Alarm firewall on my PC. There is some sort of coexistence problem with Zone Alarm and p2p or tunneling applications that cause its memory usage to continually grow. For some reason, this growing memory usage also happens to Firefox. The solution for me was to remove Zone Alarm and repalce it with the free Comodo Firewall Pro. My memory issues with Firefox and the firewall are gone.
That’s a separate issue with Zone Alarm, which really isn’t as good as advertised. Sygate and Comodo are better software firewall options. (But it’s really in your best interest to get a hardware firewall.)
Firefox’s memory leaks are well-known, so it’s not a matter of Zone Alarm somehow interfering with Firefox. Luckily, the upcoming Firefox 3.0 fixes a good lot of them.
Another fix - boolean - config.trim_on_minimize - true
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.