Memory leak ?

User Help for Mozilla Firefox
Locked
User avatar
Meehowski
Posts: 55
Joined: March 24th, 2004, 6:13 am
Location: Niskayuna N.Y.

Post by Meehowski »

Thanks all.........workin' great!!



Mike
schapel
Posts: 3483
Joined: November 4th, 2002, 10:47 pm
Location: Ann Arbor, Michigan
Contact:

Post by schapel »

fnkmaster wrote:user_pref("browser.cache.memory.capacity", 16000);

Gives FF 16 megs of memory cache to play with, which is fine in my view, anything beyond that it can cache to disk...


This will help limit memory usage only if you have more than 256 MB of RAM. If you have 256 MB of RAM or less, this can actually increase memory usage. Here's the default size of the memory cache for different amounts of RAM:

Code: Select all

   RAM    Cache
   32 Mb   2 Mb
   64 Mb   4 Mb
  128 Mb   8 Mb
  256 Mb  14 Mb
  512 Mb  22 Mb
 1024 Mb  32 Mb
 2048 Mb  44 Mb
 4096 Mb  58 Mb

If you want to help reduce the RAM Firefox is consuming, you might try these guidelines:

If you have 32 MB of RAM or less, set the limit at 1024, otherwise
if you have 64 MB of RAM or less, set the limit at 2048, otherwise
if you have 128 MB of RAM or less, set the limit at 4096, otherwise
set the limit at 8192.
Memory Leak
Guest

Post by Memory Leak »

I forgot.
GnuBeest
Posts: 51
Joined: July 14th, 2003, 1:25 am

Post by GnuBeest »

WinLin wrote:But maybe I'll try MS's X-Box for my games, it uses a linux OS ;-)

Just an off-topic clarification; Xbox is actually built around a stripped-down Win2K kernel.
mousky
Posts: 368
Joined: October 27th, 2004, 9:34 pm
Location: Canada
Contact:

Post by mousky »

daledude wrote:FF (20041228) and memory usage on an XP 256mb install is crazy. I have the memory cache set to 5megs and over the course of an hour of browsing with multiple windows and tabs it uses 170megs of memory. This slows down the machine terribly. Disabling memory cache doesn't matter the least.


Argh! Memory cache and the amount of RAM used by FF are NOT the same thing. High memory useage is NOT the same thing as a memory leak. Besides, 256MB for XP is not enough.

The Memory Cache Device is where FF stores web pages (images, etc) for quicker viewing the next time you visit the same page. Also keep in mind that most image formats (png, gif and jpg) are compressed. When FF (or any browser for that matter) displays the image, the image must be decompressed, which means the browser will use more ram than the file size of the image.

The amount of memory used in Windows Task Manager includes all memory used by FF (dlls, extensions, themes, bookmarks, live bookmarks, java related files, javascript files, plugins, etc).
mousky
Posts: 368
Joined: October 27th, 2004, 9:34 pm
Location: Canada
Contact:

Post by mousky »

Anonymous wrote:IF SOMEONE CAN PROVIDE SIMILAR INFORMATION WHEN A PROBLEM ACTUALLY OCCURS, MAYBE THEN WE WILL KNOW WHERE THE PROBLEM LIES.


People complain that FF uses too much memory - well what's the point of having 256mb or 512mb or 1gig of memory if it hardly is used? I just visited the macromedia website with IE6 and FF, clicked on the same archive of the day and Windows Task Manager reported similar memory useage. Since some of the stuff that IE uses is "preloaded'" explorer.com, IE could be using even more memory (difficult to confirm).
AnotherGuest.
Posts: 2158
Joined: December 22nd, 2004, 11:47 am

Post by AnotherGuest. »

Nicely stated, mousky.

Firefox releases memory when it is minimized or when the memory is needed by another program, but not necessarily before. So high memory use is expected behavior, and apparently not detrimental in any way.
User avatar
LeRoi
Moderator
Posts: 10346
Joined: September 15th, 2003, 10:22 am

Post by LeRoi »

This sluggish snail browser certainly performs excellently on my system. LOL! :p
terrypin
Posts: 1642
Joined: January 17th, 2005, 10:42 am

Post by terrypin »

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

--
Terry, West Sussex, UK
Terry, East Grinstead, UK
Win 10 Pro, Waterfox 56.1.0 replaced Firefox 56.0.2, TMP 0.5.0.5pre
AnotherGuest.
Posts: 2158
Joined: December 22nd, 2004, 11:47 am

Post by AnotherGuest. »

What the heck? :turn-l: Either two messages just disappeared, or I posted this on the wrong thread. Oh, well, it's still pertinent, I think.

Justin Rotgyn,
Try this.
1. Reset your browser.cache.memory.capacity (right click on it to get the menu).
2. Restart FF. In the about:config window you should no longer see a browser.cache.memory.capacity setting. That means the maximum size is set to default.
3. Now watch your memory cache in an about:cache tab. Open lots of tabs with images, enough so the memory cache is well above its maximum size. (Search Google for cat or dog images. That's a good one. Or use pictures on your hard drive.) Be sure to refresh the about:cache tab so you can see the updated numbers.
4. Now close the tabs and update the about:cache window again.
5. You should see the cache go down (probably not to zero, but at least down to the Maximum Size).

If not, you've got yourself a bug. Please try it and report back to us.


Not releasing memory
As for not releasing memory when requested by other programs, that's a possibility, based on a lot of reports. But if you actually try it, you can watch memory get released when it is needed. The test is a little tricky because there are various ways of displaying the size of available memory and the Windows swap file, but if you do the test right, you should see memory being released. If not, you've got yourself proof of a bug. You would make lots of people happy if you could find a reproducible test case.

But because there are so many operating systems, that test is a little more complicated. Would you mind trying the first one, and then we can talk about the second?
schapel
Posts: 3483
Joined: November 4th, 2002, 10:47 pm
Location: Ann Arbor, Michigan
Contact:

Post by schapel »

terrypin wrote:...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...


The Mem Usage column in the Windows Task Manager gives the "working set" of each process, that is, the amount of memory that's actively being used. By default, Firefox plays nice and marks most of its memory as inactive when you minimize the window. When you un-minimize the window, the memory becomes active again. This creates the illusion that memory is being released. No such thing is occurring.

If you want to see how much memory a process is allocated, look in the VM Size column instead. It is normal for this memory to only increase and never decrease. This is because the heap gets fragmented and there's often no way to shuffle items around in memory, meaning the free space can't be gathered all up and given back to the operating system.
Guest
Guest

Post by Guest »

ok, several people compare firefox with ie. that is wrong. everyone knows that comparing firefox with ie in memory usage cant be serious.
but i got the memory problem, too.

im using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041109 Firefox/1.0 (MOOX M3) on XP. the firefox build doesnt matter. i have tried moox and official builds of 1.0 with and without extensions. under all test the memory usage with one window, one tab climbs to 110mb phys ram and 120mb vm within one hour. i can reproduce this behaviour. for some mor testing, i installed k-meleon (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041220 K-Meleon/0.9) for windows. as you can see, it's a 1.7.5 branch of mozilla code. surfing the same site as under firefox for an hour, the memory usage stays at 10mb phys memory and 16mb vm.

i dont know if it is a windows xp problem (i doubt it, reference: k-meleon) or a firefox related issue, but firefox using over 110mb of ram is too much.
AnotherGuest.
Posts: 2158
Joined: December 22nd, 2004, 11:47 am

Post by AnotherGuest. »

schapel wrote:It is normal for this memory to only increase and never decrease.

It decreases on my XP and other systems. I think you mean it tends to increase over time because of fragmentation.

But could this cause undiagnosed major slowdowns or crashes? My XP systems always warn me when I am low on virtual memory, so I know what is happening.
dmacfox
Posts: 4
Joined: November 22nd, 2004, 9:41 am
Contact:

Post by dmacfox »

Okay, here's an experiment I ran. I am using Win XP Pro, SP1, on an IBM T30 laptop with 512M memory. If you need more environmental facts, please ask. I ran Firefox "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0" with the following results from Windows task manager (Mem Usage - VM Size):

Start up with default blank window: 20172 - 11400
Quit and start up again: 19660 - 11108
Wait for 2 mins no activity: 20188 - 11508
Load news.google.com into blank window: 23320 - 17132
New tab - load my.yahoo.com: 33048 - 24112
New tab - load weather.com: 36716 - 27060
Let bake for 10 mins, no user activity: 39248 - 29524
New window and open new website: 39426 - 29712
Browse some images on that website: 44936 - 35196
New window and open new website: 48512 - 38744
Browse that web site a bit: 51600 - 41688
New window and open new website: 59028 - 49128
More browsing in all open windows: 64152 - 54112
More browsing in all open windows: 64680 - 54600
New window and open new website: 76048 - 65828
New window and open new website: 81312 - 71156
New window and open new website: 84768 - 74004
New window and open new website: 96844 - 86820
New window and open new website: 99216 - 89020
Close all but first window (with 3 tabs): 77372 - 66944
Open 5 new windows, each with new website: 83792 - 73696
Open 5 new windows, each with new website: 101424 - 91132
Close last 5 windows: 91156 - 80828
Close earlier 5 windows, leaving only first window open: 79348 - 68840

Thats what I experience every day, which is why it is necessary to close down Firefox completely and start it up again - it seems that it will keep consuming more memory the longer I use it until I shut it down and restart it.

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

Post by Guest »

Anonymous wrote:...but i got the memory problem, too. ... firefox using over 110mb of ram is too much.

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.

The reason I make the distinction is that the RAM really is released by FF when it is needed by other applications. Did you see my note above about testing? If you don't believe me, try it. By the way, schapel is right about virtual memory. It is defined as RAM plus swap file.

I don't know. There may be exceptions to releasing RAM. Maybe over a long time it leaks a little. But RAM use is always going up and down a lot with most programs, and we don't quite have a smoking gun yet. Maybe we're getting a little closer.
Locked