Closed Bug 370202 Opened 17 years ago Closed 16 years ago

memory leak when run for long time

Categories

(Firefox :: General, defect)

2.0 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jon, Unassigned)

References

Details

(Keywords: memory-leak)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

If I run FireFox for 24 hours, note the used system memory, quite FireFox, and then return to FireFox, I can often regain between 100 and 200 MB of RAM.  FireFox is using more and more memory as it runs

Reproducible: Always

Steps to Reproduce:
start FireFox.  Use it for 24 hours. Note system memory usage using TaskManager.  Quite FireFox.  Restart FireFox. Note system memory usage has declined by at least 100 MB
Actual Results:  
over 100 MB of memory is reclaimed

Expected Results:  
memory usage should not change
do you use gmail, yahoomail or visit pages with animated pictures, eg flash?
Version: unspecified → 2.0 Branch
I do not use gmail.

I check the yahoo mail web pages occasionally, perhaps once every few days.  I go in, check mail, and then get out of that page (but keeping FireFox up, usually).

Since I tend to keep FireFox up for days at a time, I could quite likely have visited a page with an animated picture, or one that used Flash.  There are MANY web sites that "look" like they're done in HTML, but are actually done in Flash, so it would not be easy for me to be sure.

I hope this was helpful...

:)

Jon
(In reply to comment #3)
>
> visited a page with an animated picture, or one that used Flash.  There are
> MANY web sites that "look" like they're done in HTML, but are actually done in
> Flash, so it would not be easy for me to be sure.
> 
> I hope this was helpful...

not really. can't help without greater detail.  and it is easy to tell if an image is flash - install flashblock (which is how I avoid the problem) or right click on image and if it shows a flash menu then ...

don't leave such pages open for more than a couple minutes and you probably won't have a problem.
more info:
 http://kb.mozillazine.org/Reducing_memory_usage_-_Firefox
 http://kb.mozillazine.org/Flash#Memory_Use
please update the bug when you narrow down the problem.
I do experience the same symptoms as described here or in bug #378401 or in bug #365024 or in bug #358088.

I know this is vague but Firefox 2.x seems to be more prone to memory hogging
than 1.x versions.  For the time being I have to exit Firefox 2.0.0.5 when its
memory consumption exceeds 300 MBytes as my system only has 512 MBytes of RAM.

All I can say, I never experienced memory problems before in FF 1.5 even when running for days. On the other hand, with FF 1.5 I did not have so many extensions installed. They can be a cause for memory consumption, too (bug #358170), I guess.
Similar problem. FF2, WinXP Pro. I monitor 5 to 12 ebay pages and leave open for days.  FF and Windows runs slower and slower. Task Manager says FF using 255,564K. Close ALL FF browser windows, show only blank page, mem still at 125,900K.  Won't go away until FF quit completely, memory takes 7-15 seconds to release.  I run nightly scans with AVG antivirus, AVG antispyware and Counterspy V2. Maybe that is a factor.
Typo: all pages closed, blank screen-- mem still at 251,900K.  My system has 1GB ram.
(In reply to comment #0)
> User-Agent: (snip) Windows NT 5.1;
> I can often regain between 100 and 200 MB of RAM. 
> FireFox is using more and more memory as it runs

To jon bondy(the bug opener), and Daniel Kabs & jeff jourard ("Me too" comment posters):

Really memory leak? Is there any apparent evidence of memory/resource leak?

Completely same questions & requests as Bug 392297 Comment #2 to you from me.
(At least read Bug 320915 Comment #46 and read thru bugs/comments of      ) (bugs/documents pointed in it, and try config.trim_on_minimize=true first.)
(And, please note that I never say "no memory/resource leak".             )
Whether there is a "memory leak" or a "frumious bandersnatch", the fact is that if you leave either Thunderbird or FireFox running for a long time, and then exit out of them, and then restart them, a huge amount of memory is reclaimed.  I like to keep both open all of the time, Thunderbird so I can see incoming mail, and FireFox because I have to log into sites less often.  This is very awkward with these applications.  Last time I complained about this, I was told something like "don't use Flash files".  Providing a browser that will not work with standard data is pretty ... well ... lame.

I'm finished complaining about this, but it is a REAL problem.
(In reply to comment #10)
> I'm finished complaining about this, but it is a REAL problem.

Phenomenon of "exhaust of real memory by Fx/Tb on MS Win NT or later" was introduced by default change of config.trim_on_minimize from true to false when Firefox/Thunderbird 1.5, although main cause is MS Win's memory management design. This is why I opened Bug 381950.
If you can accept issues of Bug 76831 Comment #276 thru Bug 76831 Comment #352 (or they are not problem in your environment), please try config.trim_on_minimize=true (which was default before Firefox 1.5).
I use Mozilla/Seamonkey since Mozilla M17, and I use config.trim_on_minimize=true, but I didn't experience severe slowdown problem when resume from suspend, because Mail&News executes automatic/periodical download in background.
But this may not be true when Firefox. If you experienced issues of Bug 76831 Comment #276 thru Bug 76831 Comment #352 by config.trim_on_minimize=true, please change back it to false.  
Note:
Even if config.trim_on_minimize=true will improve real momery usage, there are apparently true memory leak problems in addition to inefficient memory(virtual) usage issue. So, "24hour*365days" operation is impossible, from point of view of not only "real memory" but also "virtual memory", even if improved. Restart of Fx/Tb at least per a day will be required, I think.
What is "config.trim_on_minimize=true"?  That is, how do I "do" that?  I looked up "config" in the Help, but there is nothing there.  Nothing under Tools.  Nothing under Help.  Pretty cryptic.
(In reply to comment #13)
> What is "config.trim_on_minimize=true"?  

Enter "about:config" in URL bar and vreate the value above.

Please read Bug 76831 Comment #276  and following as WADA pointed out.
My suggestion would be that this facility be available through SOME method that is 1) less obscure (like a menu entry) and 2) documented (accessible through Help).  After all of these releases, to have this facility be so hidden seems ridiculous.
Regarding memory consumption, I get a much better mileage when I turn off the add-on "Firebug". See e.g. 

http://code.google.com/p/fbug/issues/detail?id=127

So for anybody experiencing memory hogging using Firefox and Firebug, I suggest updating it, see http://fireclipse.xucia.com/#Downloads 

As external components can have a negative impact on memory usage, experienced  developers suggest to disable all add-ons while testing Firefox.
I've just read all comments and can confirm the problem. Firefox is memory greedy. But you don't necessarily have to browse hundreds of tabs a day to make the problem happen. As reported in the "Script execution & Memory greedy usage in Firefox" [1] topic I've just created on mozillaZine, one tab and a buggy script is enough to have a high memory usage by the Firefox process. That's why I think it's important to try to cut the problem down before reporting a bug. One tab, two tabs… try different websites… That's how I got to a one tab problem for a one website, Cityvox in my case.

All comments regarding my problem are welcome. Maybe it will even help fix this one !

Notes :
* [1] <http://forums.mozillazine.org/viewtopic.php?t=589552>
Attached file Testcase...#1
The page is just copy and paste and not validated.

Nevertheless, opening it makes firefox' memory usage jump from 60 MBytes to 300 MBytes.
I also have similar problems. 
I try to use Firefox for long time, even for weeks, but I have to close Firefox after a week or two, as it increases memory usage to 200-400 Mb or even higher!

Unfortunately, when I close all tabs, the memory usage is not fully recovered. That's bad behaviour.

I have to use Opera, as it has less memory leaks, and have to restart less often.
Nor Opera, nor Firefox is a star in memory handling, but is seems Opera does memory handling a little bit better.

I will use Firefox again, when memory leaks will be fixed.


I have several add-ons installed on Firefox, so it may happen, that they have the memory leaks, not Firefox. In that case would be a good idea for Firefox staff, to check plugins for memory leaks and add "Officially Checked" stamp for add-on releases...
Also reported here : http://mozillalinks.org/wp/2008/02/firefox-3-ultimate-feature-performance/ (see the table)
But, according to that site, it's no longer reproduceable with Firefox 3 Beta 3.

I suggest marking as WORKSFORME if no one can reproduce with current Firefox 3 beta.
The test in the link you provided is a different test than the original bug here (it was for 1 hour vs. the bug here specifies 24 hours).

But, the bug posted here is vague and does not specify what browsing activity occurred during the 24 hours.  So perhaps the bug should be closed, but not for the reason you gave.

I can testify that there is some behavior that resembles a memory leak in beta 3, as just last night I left firefox running overnight and in the morning came in to find the browser using over a gigabyte of memory.  Unfortunately I can't reproduce the behavior reliably enough to be able to file a bug.
Do you have extensions ?

If it isn't always reproduceable, it would be useful to check which pages you let opened when this bug occurs. Then after some times you could hopefully discover which page is the culprit, which would make it easier to create a minimized testcase.
My browsing habits are erratic, and I have been unable to discern a pattern as to when firefox eats memory.  I have disabled all extensions in an attempt to narrow down the problem, but to no avail.

I am excited about the possibility of using about:memory to see where the memory is going (see bug 392351).
This bug has existed FOR YEARS. And every time I mention it, I get comments like "how do you reproduce it" or "don't use Flash files".  It seems to me that the years of waiting for this bug to be fixed are more an indictment of how the program is made than anything else.  There should be some way to create a log of web sites visited.  There should be a way to enable a log of memory allocated and deallocated, and a way to match these up and find the discrepancies.  I was doing this successfully ten years ago.  This is not rocket science.  Someone just has to get serious about debugging the program.  If I sound annoyed, it is because I am.  I find it pretty difficult to be confident about the REST of the software when these kinds of problems remain undetected for years.
Are you volunteering, Jon?
Not really.  I know nothing about how this software was developed (what language, what libraries, etc).  I am just depressed when huge projects like this lack such obvious debugging tools.  Or even why each of the operating systems lack these fundamental tools (why should each compiler maker or each project have to roll their own?).   I can explain how to implement them, if you wish.  But I am not in a position to implement them for you.
jon, the Mozilla project developed extensions memory debugging tools, they were used to greatly improve the memory usage of Firefox 3, see e.g. <http://wiki.mozilla.org/Performance:Leak_Tools> and <http://blog.pavlov.net/2008/03/11/firefox-3-memory-usage/> for the result. But that work is not going to benefit Firefox 2 any more (which this bug is apparently about), so I guess this bug can be resolved.

Or has somebody tried to run the testcase (which doesn't display anything for me at all?!) over night in Firefox 3 beta 5 and it still increased the footprint noticeably?
(In reply to comment #27)
> Or has somebody tried to run the testcase (which doesn't display anything for
> me at all?!) over night in Firefox 3 beta 5 and it still increased the
> footprint noticeably?
> 

I will run the testcase now for some hours to check this with leak gauge. 

Jon for leak testing you can use tools like "leak gauge" http://wiki.mozilla.org/QA:Home_Page:Firefox_3.0_TestPlan:Leaks:LeakTesting-How-To
Keywords: mlk
I have not noticed quite the same degree of difference when I quit FireFox or Thunderbird as I once did.  Perhaps the problem has been solved.
i was running this testcase over night and its not showing a leak with the beta 5 Release Build:

Summary:
Leaked 0 out of 32 DOM Windows
Leaked 0 out of 66 documents
Leaked 0 out of 13 docshells
Leaked content nodes in 0 out of 76 documents

So i think if there was a memory leak, its fixed now
I agree, it seems fixed.
jon, if you find evidence to the contrary: please reopen, if it is about this testcase. If you find another page or testcase that leaks, please file a new bug.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: