Memory leak ?

User Help for Mozilla Firefox
Locked
AnotherGuest.
Posts: 2158
Joined: December 22nd, 2004, 11:47 am

Post by AnotherGuest. »

Interesting, dmacfox, and thanks. It leads to questions, of course.

1. How high will it go before you run into problems? I assume you do run into performance problems.
2. How low can you go on system resources (available RAM plus Windows swap file) before there is a problem? Or do you ever run low?
3. If you do run low because of FF, what happens when you start another big application?

I'm leaving my system running all the time now, and recording long-term performance to see what happens.
mousky
Posts: 368
Joined: October 27th, 2004, 9:34 pm
Location: Canada
Contact:

Post by mousky »

dmacfox wrote:I hope this helps solve the problem. If you need more information or a more controlled experiment, please let me know.


Now run the same "experiment" using IE and report back. If the numbers are close (given that some components of IE are loaded by other process), can we put this "FF uses too much memory" thread behind us?
mousky
Posts: 368
Joined: October 27th, 2004, 9:34 pm
Location: Canada
Contact:

Post by mousky »

terrypin wrote:(Novice FF user, 2 days since replacing MSIE6.) Up thread several users mentioned that minimising FF reduced the memory usage. I was curious so I loaded Task Mgr on this XP PC, noted the FF was taking 47.1MB, and minimised it. Sure enough., it dropped immediately to 9.7 - but then increased fast. After 1 min it was at 14.6 and after 3 mins it had reached 23.2 and still climbing. (For all I know, it would have continued until it wa back at 47.1?)

Could someone explain that please? I'd have expected it to be static. Now that I have it maximised again, while I compose this in one of two tabs (the other is playing jazz from BBC), it's rock steady at 48.96.


This behaviour is also exhibited by most Windows programs: IE, Word, Excel, etc. They all release a bunch of RAM when minimized and will slowly reclaim that RAM if it is not used. This is not a FF only issue.
dmacfox
Posts: 4
Joined: November 22nd, 2004, 9:41 am
Contact:

Post by dmacfox »

Here's the results using my copy of IE, alongside the Firefox results:
Firefox IE 6.0.2800.1106.xpsp2.040919-1003
Start up with default blank window 20172 - 11400 30936 19336
Quit and start up again 19660 - 11108 30772 19216
Wait for 2 mins no activity 20188 - 11508 30722 19216
Load news.google.com into blank window 23320 - 17132 37136 22904
New tab - load my.yahoo.com 33048 - 24112 50988 35408
New tab - load weather.com 36716 - 27060 63248 47220
Let bake for 10 mins, no user activity 39248 - 29524 66052 49732
New window and open new website 39426 - 29712 82528 66356
Browse some images on that website 44936 - 35196 85324 68852
New window and open new website 48512 - 38744 97768 81260
Browse that web site a bit 51600 - 41688 99004 82240
New window and open new website 59028 - 49128 114932 97700
More browsing in all open windows 64152 - 54112 124148 107148
More browsing in all open windows 64680 - 54600 123200 110392
New window and open new website 76048 - 65828 130868 118092
New window and open new website 81312 - 71156 143828 131048
New window and open new website 84768 - 74004 149172 141988
New window and open new website 96844 - 86820 159804 152576
New window and open new website 99216 - 89020 173604 166276
Close all but first window (with 3 tabs) 77372 - 66944
Close all but first window 71436 63504
Open 5 new windows, each with new website 83792 - 73696 126324 117444
Open 5 new windows, each with new website 101424 - 91132 199956 194564
Close last 5 windows 91156 - 80828 150104 143760
Close earlier 5 windows, leaving only first window open 79348 - 68840 103732 96500

[sorry about the formatting - you can cut and paste into a spreadsheet to see it line up]

It looks like IE does a better but not perfect job of bouncing back from opened and closed windows. In a perfect world, I'd expect an application to be able to clean up all resources consumed by a previously opened window when that window closed. The question I guess we're all working on is how close to perfection can we get? My problem as a user of Firefox is that it consumes memory almost monotonically, and so it crowds out other programs and eventually I have to quit and restart Firefox to free up all of the memory it doesn't release itself.

In answer to anotherguest, above, there's nothing special about the system problems I experience. It is the same as if I were running Photoshop, opened a huge TIFF file, and that crowded out a bunch of other programs. If my page file is big enough, I just wait for a lot of disk IO; otherwise, I have to quit something or quit Photoshop. My complaint about Firefox is that it grows in size the longer I use it. This does not happen with Photoshop, for example. When I close my large TIFF, it frees up most of its resources. I can edit files in Photoshop all day without it taking over my system. I can't run Firefox all day without it taking over my system - even if I close windows as I am finished with them. I hope I'm being clear. Please ask if I'm not.

And, thank you Firefox team, for a truly great browser. It is still the only browser I use all day, every day.
dmacfox
Posts: 4
Joined: November 22nd, 2004, 9:41 am
Contact:

Post by dmacfox »

Two points of clarification to my last post:
1) the line "Close all but first window 71436 63504 " is supposed to show values for just the IE column. In the case of Firefox I left only the first window with its three tabs open. In the case of IE, I closed all but the first window, and IE doesn't have tabs. The html munges the formatting - you will get better results if you copy the numbers from the html source of this page and then paste into a spreadsheet.
2) The rate of growth of FF was greater (but unmeasured) until I added a line to the config to set the browser.cache.memory.capacity to 16000.
terrypin
Posts: 1642
Joined: January 17th, 2005, 10:42 am

Post by terrypin »

I'm trying to follow this thread and learm from it. But I'm not sure what figures are being used by everyone. For example, what are the 4 numbers dmacfox gives in his detailed test results please?
"Start up with default blank window 20172 - 11400 30936 19336"

What is the definitive source for seeing memory usage? I have used two methods: Task Manager (hit Ctrl-Alt-Del); and entering 'about:cache' in FF. On starting ths morning, this is what I saw:

From XP Task Manager
====================
Mem Usage 27148 K
Peak Mem Usage 28448
VM Size 23316

From FF 'about:cache'
====================

Memory cache device
--------------------
Number of entries: 112
Maximum storage size: 16000 KiB
Storage in use: 1537 KiB
Inactive storage: 970 KiB

Disk cache device
-----------------
Number of entries: 3495
Maximum storage size: 50000 KiB
Storage in use: 33528 KiB

Which of these are supposed to be broadly equivalent? What does the 'i' in 'KiB'
mean?

Thanks, mousky, for reply about minimised usage.


--
Terry, West Sussex, UK
schapel
Posts: 3483
Joined: November 4th, 2002, 10:47 pm
Location: Ann Arbor, Michigan
Contact:

Post by schapel »

Just look at the VM Size to see how much memory a process has been allocated. Note again that if you never see it decrease, this does not mean there's a memory leak.

KiB stands for kibibytes, which is 1024 bytes. This used to be called a kilobyte, but that term sometimes meant 1000 bytes or 1024 bytes depending on the context. See <a href="http://en.wikipedia.org/wiki/Binary_prefix">this Wikipedia article for more information</a>.
mousky
Posts: 368
Joined: October 27th, 2004, 9:34 pm
Location: Canada
Contact:

Post by mousky »

If I read dmacfox's results, the first two numbers represent Mem Usage and VM Size for FF and the last two represent Mem Usage and VM Size for IE6. If that is right, then FF uses LESS memory than IE.
schapel
Posts: 3483
Joined: November 4th, 2002, 10:47 pm
Location: Ann Arbor, Michigan
Contact:

Post by schapel »

dmacfox wrote:I hope this helps solve the problem. If you need more information or a more controlled experiment, please let me know.


Try what I suggest in <a href="http://forums.mozillazine.org/viewtopic.php?p=1147966#1147966">this post</a>. And when you speak of "crowding out other programs" could you very specific as to what symptoms you're seeing?
AnotherGuest.
Posts: 2158
Joined: December 22nd, 2004, 11:47 am

Post by AnotherGuest. »

Thanks, dmacfox. I think we're getting a lot closer to knowing what's going on. I do agree with schapel that just a little more information is needed, however. He has outlined a nice, systematic way to trouble-shoot this.

In addition, there are still some problems with pinpointing the problem:

1. IE used more memory and virtual memory than FF at <i>every</i> step.* More importantly, IE also greatly increased in memory use and VM use, and did not return to its previous lower values. So why is this a FF problem and not an IE problem?

2. Does FF ALWAYS creep up in VM use, or does it release memory and/or VM before there is a slowdown? Is running low on VM directly traceable to a slowdown?


There's something to note about the VM size. There is a real confusion about the definition. Sometimes it is defined as RAM used plus page file size, and sometimes just the page file. Since the XP Task Manager sometimes reports it as less than Mem Usage, it must refer only to the page file (aka, swap file)--contrary to what I wrote in a previous message.

________
* I assume you opened the same Web pages for both FF and IE. Correct?
AnotherGuest.
Posts: 2158
Joined: December 22nd, 2004, 11:47 am

Post by AnotherGuest. »

Please note: MozillaZine has reversed the order of two messages. This message quotes the one following it!

schapel wrote:In general, it looks like people are paying too much attention to numbers and not enough attention to explaining what they're doing with Firefox and the specific problems it creates on their computer.

<b>That may be exactly what's wrong.</b> You have a way of putting your finger on the problem.

Right you are. As you pointed out, the "Mem Usage" column is terribly misleading, as is the documentation. <b>Folks, as an example of what's wrong with trying to use the Task Manager to determine memory use, take a look at this: http://forum.java.sun.com/thread.jspa?f ... &trange=15 .</b>
schapel
Posts: 3483
Joined: November 4th, 2002, 10:47 pm
Location: Ann Arbor, Michigan
Contact:

Post by schapel »

AnotherGuest. wrote:There's something to note about the VM size. There is a real confusion about the definition. Sometimes it is defined as RAM used plus page file size, and sometimes just the page file. Since the XP Task Manager sometimes reports it as less than Mem Usage, it must refer only to the page file (aka, swap file)--contrary to what I wrote in a previous message.


I think you're confusing a few different things. The "VM Size" column in the Windows Task Manager shows how much memory the OS has allocated to each process. The "Mem Usage" size is something I would just ignore; without deep knowledge of how Windows manages memory I don't think we can interpret the numbers given in that column.

The total size of virtual memory is the size of the physical RAM plus the size of the page file. Just to confuse you, some parts of the Windows UI shows you the page file size and other parts show you the total size of virtual memory. This number is the maximum amount of memory that can be allocated to all processes.

In general, it looks like people are paying too much attention to numbers and not enough attention to explaining what they're doing with Firefox and the specific problems it creates on their computer.
danse
Posts: 5
Joined: October 29th, 2004, 12:14 pm

Post by danse »

Memory problem, or actual performance issue, such as system bogging down? Not trying to imply there's no problem, but a lot of people are just looking at memory use and assuming there must be some problem. We need to be specific about what is actually happening.


performance problem. the longer firefox runs, the more sluggish the system performs. i've read about high cpu usage while running embedded objects. that is ok. but experienced lag while scrollig simple textpages and stuff isnt enjoyable.

but, the crux of matter isnt firefox itself, it's tabbed browser extension (tbe). yesterday, i looked through the site of tbe and found the article about advantages and disadvantages of tbe (http://piro.sakura.ne.jp/xul/tabextensions/tradeoff.html.en). shortly after getting a clean distro package from mozilla.org and removed my profile, i havent experience any memory issues. the fact that tbe replaces some crucial files in the firefox dir could be the problem with new profiles or installations (profile not removed).

please test the issue with firefox and tbe and tell me if i'm correct.
AnotherGuest.
Posts: 2158
Joined: December 22nd, 2004, 11:47 am

Post by AnotherGuest. »

Well, as a rule of thumb, if you are having a problem, all extensions are suspect until proven otherwise. It's good to add them one at a time, and only add the ones you really need.
danse
Posts: 5
Joined: October 29th, 2004, 12:14 pm

Post by danse »

absolutly. i didnt checked the behaviour of mrproper firefox installation, so i never thought it would be tbe that causes the problem. as stated, only add what you need. that is useful, but with tabbed browsing, i like the featureset of tbe and no other combination of extension can supply these features. and of course, i dont like a vaste amount of extension just for the purpose of replacing tbe (sometimes, several extensions provide the same functionality and are hard to configure). help for those bleeding edge tbe victims. try to use an older version of tbe. it doesnt provide the latest featureset, but runs very stable with ff 1.0.

try http://www.pryan.org/mozilla/firefox/mmoy/Extensions/ if you really want the beauty of tabbed browsing.
Locked