This thread was archived. Please ask a new question if you need help.
Why does Firefox 4 (4.0.1 specifically) leak memory?
Answer: I figured it out.
History lesson first. Ever since the 4.0.1 update, Firefox 4 has been crashing A LOT. It's gotten so bad that FF4.0.1 will eat memory with no end in sight and eventually Windows (Win 7 64-bit) forcefully close the program due to an out of memory error.
I have 8 GB of RAM installed. And, it would crash once it exceeds 1.5 GB of RAM used by Firefox 4. I've seen Firefox 4 go up to 1.85 GB of RAM in Task Manager. This is with 20 tabs open.
MSNBC Leak Monitor issue: Leak Monitor log from MSNBC.com
All Replies (19)
Same issues. Seems like this version was ether not tested thoroughly on win7 machines , or they simply let it slide with the leak .
OldNoob द्वारा सम्पादित
I would suggest your problem is not Firefox or its combination with Win7.
Have you tried all the usual checks - Problematic Extensions, Firefox Safe Mode, new bare profile? A lot of add-ons will have changed on updates as well as FF4.
Be very suspicious of third party toolbars.
I've only tested it as follows: Only one extension: Leak-Monitor Add-on Firefox 4.0.1 One tab open
The more tabs, the more pop-ups, and I would notice that memory just continues to crawl higher and higher.
This will be my sign off. You seem to need more expert help.
As I said above, though, this is not happening to me; nor I would guess to a vast majority of users.
Forget the Leak Monitor for a moment. Have you tried my suggestions?
I would follow this by uninstalling the Leak Monitor for a tryout - I would bet it is adding to your problems.
Other standard tests are to disable your Anti-Virus and Firewall programs for a brief test.
alan_r द्वारा सम्पादित
It also depends, I've noticed, on whether you're using the x64 or x86 version of Firefox. x86 uses less memory overall, because that's where they've had time to optimize the program over the previous 4 versions. All 4.0 did to x86 was a major graphical overhaul and making the browser a bit faster. x64 has had almost no time for testing compared to x86.
I notice that in my post above I forgot to mention that my Win7 is 64 bit. And as I said, no problems. Just for completeness - not much help I'll admit but I think you'll have to look somewhere else.
Win7 64 4GBs and FF is eating well over 500mbs of my memory (2-10 tabs). One more day and it's over to chrome! Has FF seen it's day or is it going to rebound? Stay tuned!!!!
Having a memory leak issue as well on 4.0.1 with OS X 10.6.7
Tried disabling all Add-Ons, it doesn't change anything. Firefox will continue to eat memory slowly, until there is nothing left. Even if you close all your tabs and just leave one open, it will still hold onto the memory it was using and in most cases continue to increase.
I've been using Firefox for a long time, but this is a serious problem that's been going on since Beta.
Have the same problem. Was just watching precise 4 streaming flash vids on facebook for 1 hour and it ate 300 MB of memory. It's like the then outdated videos don't free space after watching and are still allocated in memory instead of the cache on the hard drive. It's a real mess compared to 3.6.
Also had another issue when not so reading a twitter search stream over a period of time. FF didn't really release the timing sensitive old data.
I'm running XP64 on an more or less old fashioned machine. But i'm sure it counts.
octoberasian: I, too, am experiencing this phenomenon. I shut my system down, pulled the EIC cable, held down the power button - then replugged and rebooted. I closed down every unneeded application that I have set to auto-start. Finally, I opened a single Firefox 4.0.1 window and let it sit. It began with consuming 43 Mb of memory. By afternoon - about 5 hours later - it was up to 203 Mb. There is definitely something very wrong with this version. It does the same on all the machines we have, sans our server. We don't use the server for anything but being a server & it has some version of Firefox 3 on it anyway. No Java Scripts were running, nor were any Adobe ARM or any plugins. I noticed when plugins run - the memory leakage goes into overdrive. Hey, I'm just sayin'...
Same problem. Through all of the recent Firefox 3 versions, I haven't had to restart my browser more than like once every couple weeks or so. Now, just about every 24 hours, Firefox gets up to around 2GB of RAM used, leading to a crash.
I'm running Windows 7 on a 64 bit machine.
I switched to FF Beta 6.0 a1 and no problems. Windows doesn't report an out of memory issue. Memory usage stays at 900 MB to 1.2 GB with 20 tabs open.
I switched to FF Beta 7.0 a1 and no problems. Windows doesn't report an out of memory issue. Memory usage stays at 800 MB to 1.0 GB with 20 tabs open.
I've tried FF 5 Beta and no problems other than Flash 10.3 crashing every now and then. I would have to be forced to close plugin-container.exe*32 in Task Manager to get Firefox 5 Beta working again.
Conclusion: It narrows it down to 4.0.1 as being a buggy build.
Hardware acceleration does not affect this and whether or not it's enabled has no bearing on Firefox's memory usage except on how fast and smooth the webpage is rendered.
Hey I found what may help you with the memory problem (at least it helped me!)
Same memory leaking on OS X 10.6.7. Not a win7 issue, it's a Firefox 4.0.1 issue.
I noticed today that FF will hemorrhage memory at a rate of 300 MB/hr just sitting there but when I go and click on a link or something, it will free it up. So, I can let it sit for a few hours, get it up the 1.5 GB, click on a link, and it will go back to 300 MB or so.
I'm curious is this is also the case for anyone here that is experiencing a memory issue. Perhaps it is only those who leave their browsers open and unattended for a while who will notice the problem.
Yet another hemorrhage here. It started around the time that FF 4 came out. I kept hoping that with thousands of people complaining about the same issue that it would get fixed. I'm on FF 5.0 and it's still not fixed.
The problem seems easy to reproduce:
1) Start FF in safe mode on a news article: "C:\Program Files\Mozilla Firefox\firefox.exe" -safe-mode "http://www.mercurynews.com/politics-government/ci_18403225" 2) Put Firefox in the background (I did not minimize it. I simply switched to using other applications and left FF sitting there on that single web page and never had a part of it visible on my desktop other than the taskbar icon).
The observed leak for the firefox.exe working set is 33,032 bytes per second. In the 23 minutes FF was sitting there in the background the working set grew by 43mb. This works out to 2.7gb per day.
I did some more testing on this. I ran the same test as before where I started Firefox in safe mode for a single mercurynews.com web page and let it sit idle in the background.
Firefox 3.5.2 does not leak. Firefox 3.5.3 and all later versions I tested leak at the same rate as Firefox 5.0
I tested with 3.5.4, 3.5.6, 3.5.10, 3.5.19, 3.6, 3.6.18, and 5.0. I know all of the 4.X versions I ever used leaked.
The measurements were done using Performance Monitor (perfmon.exe) which comes with Windows. I was logging the following values for the firefox.exe process every 15 seconds: Page Faults/sec Pool Nonpaged Bytes Pool Paged Bytes Private Bytes Thread Count Virtual Bytes Working Set For the versions that leak the Working Set shows a 270,000 byte or higher increase every 15 second and Virtual Bytes jumps by 1,048,576 bytes every minute.
The behavior for version 3.5.2 is that the delta Working Set was often 0. Sometimes the working set would go up or down by a small amount such as 28,672 bytes. The delta Virtual Bytes value was nearly always 0. Every five minutes 1,048,576 bytes would get released and 30 or 45 seconds later 1,048,576 bytes gets added.
The Firefox 3.5.3 release notes at http://www.mozilla.com/en-US/firefox/3.5.3/releasenotes/ were not enlightening. As it's so easy to reproduce in v 5.0 it'll be easier to debug that version.
What I did not test was to see if versions 3.5.3 to some later version capped the increase. I know somewhere in the late 3.X series there has been no cap with people complaining about usage in excess of 1gb