Closed Bug 213534 Opened 22 years ago Closed 19 years ago

Mozilla uses way too much memory (memory leak?)

Categories

(Core Graveyard :: GFX, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED INVALID

People

(Reporter: bill+mozilla-bugzilla, Unassigned)

Details

Attachments

(8 files)

Both with 1.4 and 1.5a (2003072203) I'm seeing unreasonably large memory usage and leaks over time on Mac OS X (10.2.6). Starting a fresh Mozilla on my system uses 47MB of resident memory and 1GB of virtual memory. Over time, opening and closing windows and tabs, the resident size can climb to over 300MB and the VM size to over 3GB, with only one open window showing my all-text homepage. I happen to notice this since I have about that much free space on my disk and OSX handles low vm situations very poorly. Ideally both OSX and Mozilla would handle the situation better.
Just want to add my experience to this bug in the hopes that it will help you track down where the leak[s] is/are. On my home and work computers I keep to the most updated versions of Mozilla and Firebird - right now on my work computer I have the following: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7a) Gecko/20040131 Firebird/0.8.0+ The Problem: A slow memory leak that increases with usage of the browser. Firebird starts out with around 14MB or so of memory (as reported by Windows Task Manager), but as the day goes on, the memory foot print increases. Last week I was working on one application, then clicked on Firebird to bring it to the foreground, and watched as it loaded 300+MB before it could start responding to OS events and user input. After a normal day of use, starting from a freshly booted computer, the footprint can still get up around 90MB My usage consists of heavy tab use, with sometimes up to 10+ tabs in multiple windows. The memory footprint remains even after I close all but one window and one tab, and wait 24 hours for whatever processes to reclaim all that dead memory. This is on Windows XP, but I've experienced it on Windows 2000 as well. I'm one of those people that don't usually shut down their PC and can leave browser windows open for even weeks at a time. My computer at home is a WinXP SP1, Athlon 300+ (Barton) with 1.5GB RAM Work gave me a Pentium 4 2.26GHz with 256MB RAM(cheap bastards!) I've been getting this behaviour on both Mozilla and Firebird, so I assume there's a shared codebase somewhere that this bug stems from...? I hope this helps... (In reply to comment #0) > Both with 1.4 and 1.5a (2003072203) I'm seeing unreasonably large memory usage > and leaks over time on Mac OS X (10.2.6). Starting a fresh Mozilla on my system > uses 47MB of resident memory and 1GB of virtual memory. Over time, opening and > closing windows and tabs, the resident size can climb to over 300MB and the VM > size to over 3GB, with only one open window showing my all-text homepage. > > I happen to notice this since I have about that much free space on my disk and > OSX handles low vm situations very poorly. Ideally both OSX and Mozilla would > handle the situation better.
Changing os/hardware to all based on John's comment. Just as some more current data, on 1.6, OS X.3.2, I'm running 97MB real, 300MB virtual after a day's light browsing, with just this window open.
OS: MacOS X → All
Hardware: Macintosh → All
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a) Gecko/20040505 on Linux (fedora) 2.6.5-1.327 top displays: Tasks: 136 total, 1 running, 135 sleeping, 0 stopped, 0 zombie Cpu(s): 27.2% us, 4.3% sy, 0.0% ni, 60.9% id, 7.3% wa, 0.3% hi, 0.0% si Mem: 516720k total, 511812k used, 4908k free, 9592k buffers Swap: 771080k total, 640396k used, 130684k free, 45324k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 10221 user 15 0 484m 231m 29m S 11.2 45.8 78:03.04 mozilla-bin this basically says that after a little more then 3 days and nights mozilla uses around 230MB of memory. simply unacceptable on a system with 512 MB ram. i have the debug menu enabled, there is a leak-detector sub-menu, can i send some information from that? if click any of the menu items under leak detector, where is the dump file written?
k b - Mozilla may legitmately use that much RAM if you're doing alot - could you clarify what Mozilla was doing when you did that top? I think one bugzilla window open to this bug is a nice/arbitrary baseline, just so we have something to compare.
Same problem Firefox didn't crash, just freezed for few seconds, memory climbed climb to over 300MB I checked the files in my profile and found a 65 MB file named signons.txt I thought it was huge for a 20 lines ascii text file so I checked and removed the lines with a strange encoding . http://www.a_website.com (huge line here with something like ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ) email something encrypted here *password something encrypted here My file is now 3KB and Firefox is much faster and doesn't suck up to 300 MB like it used to. I wasn't able to reproduce it. ---------------------------------------- Win 2k SP4 - Firefox 0.8 - P4 2.4 512 MB
btw it happened even at startup with google set as my home page. (I think it's one of the lightest web pages in my bookmarks)
The problem is still in 1.7rc3. Windows XP. Opening tabs and windows takes memory (viewable in the PF usage box of the task manager). The only way to release the memory is to close down Mozilla.
maybe you need to lower your memory cache. mine is set at 8 mb: browser.cache.memory.capacity = 8192
Memory use crept up steadily over the 12 days period to reach the amount seen in task manager.
Just for the sake of comparison.
Hello. Not sure if I am adding this bug comment correctly, but I am also seeing substantial memory leak on OSX 10.3.4 in Mozilla 1.7.2 in general. It doesn't even take very long (a few hours) for the memory usage (as reported by Activity Monitor) to grow from a start of about 50mb to 100mb to 200mb and so on. As memory usage grows Mozilla slows to a crawl and Activity Monitor reports about 80% processor usage on my Mac G4/533 with 896mb real memory. Sure hope this helps. Thanks in advance!
mlk keyword needed?
Attached image Screens of Memory Usage FF1.0 (deleted) —
Attachment added per latest comments on this issue -- AF
Product: Core → Mozilla Application Suite
New report and a question - firstly I was using a recent nightly and I had just a ton of windows and tabs open. Probably close to a hundred tabs spread around 10-15 windows. After I closed them all memory usage was 300MB real, 1.3GB virtual. I let it sit overnight in case it was going to deallocate eventually but it didn't. Now the question - is there any kind of useful dump that could be provided to help trace this down? Somehow get a dump of allocated objects via gdb or whatever?
Status: NEW → ASSIGNED
I wish to report the following data: I'm running Windows XP SP2 with NO virtual memory, in a system with 1GB of RAM. I'm using Mozilla 1.8b, and I'm measuring the memory usage through the "private bytes" column of Process Explorer (www.sysinternals.com). After having used Mozilla on and off for a few days for browsing and reading mail, without closing it, I closed all tabs of the browser window except one, in which I entered the URL "about:blank". I also closed the mail window and cleared the cache in the preferences. The only Mozilla window that was left was the one showing "about:blank". After this, Process Manager indicated a use of 174472 kbytes by Mozilla. Minimizing Mozilla made only a very slight change in this figure. I then closed Mozilla and started it again, and again opened "about:blank" in a single tab of a browser window. The memory usage indication given by Process Explorer was then 17588 kbytes. I think this is a clear indication of some memory management problem in Mozilla. For some special reasons, I don't use virtual memory in my system. This behavior of Mozilla means that I have to close it and restart it every few days, to prevent it from eating up too much RAM.
I just wanted to add my experienced to this. I'm using Mozilla (gentoo build) under Linux on x86 (P4 1.8ghz, 512 megs). When I first start Mozilla, it uses about 47 megs. After regular usage and launching the email app, it climbs to the hundreds of megs. A common occurrence is that I will leave work for the weekend. Before I leave, Mozilla is, say, in the 250 meg range. When I come back to work on Monday, it'll have grown inexplicably to over 400 megs, making my system thrash. Closing the email program and all tabs except one DOES NOT affect the memory usage. After closing the last window, Mozilla takes over a minute to shut down completely.
One test case: 1. wget http://www.gnu.org/software/libc/manual/html_mono/libc.html 2. Run FF, top says: VIRT RES SHR 81916 25m 16m 3. Open libc.html, tops says: 192m 118m 18m 4. Open new empty tab, close tab with libc.html 191m 117m 18m This isn't good, memory should be free after closing tab. As I see it's not a memory leak (no pointer is lost), but just not freeing of memory and alocating new. I'll provide next testcase that allocate nearly 1GB of RAM and don't free it after closing all tabs except the blank one.
1. Open http://en.wikipedia.org/ 2. Search for GTK 3. Open "What links here" in new tab 4. Press "next 50" 5. Open all links below "GTK (redirect page)" (from "Graphical user interface" to "User:SECOS") in new tabs 6. Switch for first new tab "Graphical user interface" 7. Press Ctrl+F and enter "gtk" On each tab, search for all instances od "gtk", then close tab, and move to another. On some of them (I've noticed that on Emacs doing this cause large memory allocating) try to "Edit this page" write something then "Show preview" search for "gtk" and close tab. I've done this 3 or more times and always it causes huge memory allocating (1GB), closing nearly all tabs wouldn't help.
Attached image Over 300 MB VM (deleted) —
This is still an issue in Firefox 1.5 RC3. Right now Firefox is uses 200 MB of memory (with 319 MB in VM). The memory cache is set at a limit of 32768 KiB yet Firefox is using 112076 KiB. There is no reason a webbrowser should be using 319 MB of memory with no pages open after only a few hours of use.
This is still an issue in the 1.5 release. Just sitting at one page doing nothing, with the window minimized, with only one tab open causes 41 Megs of memory usage (as reported by windows Task Manager under the processes tab). Reporting the bug on this site with no other tabs open has Firefox using 52 Megs. I have no idea what could be causing this, but I figured I'd let you know that the problem is still there and it's not getting better. This (memory leak?) problem seems to have been worsened by post-1.0.7 versions. Lately I've been using 1.5, but before that I was using 1.0.7 and I didn't notice any huge memory usage by firefox, at least nothing that caused major grief. I have noticed the usage this time around (with the release of 1.5) as my computer slows to a crawl periodically as I'm working in other programs. Closing Firefox seems to fix the 'slowness'. This problem is quite annoying and I can definitely see it driving people away from using Firefox. Especially non-tech people. This is NOT a minor issue anymore.
I use FF1.5, i like to have several tabs opened but after some time i can see that every task manager refresh memory usage increses by 0.5 - 1mb until ~300mb. When i close tabs memory usage stil ~300mb
It's astonishing to see how this bug is still arround in 1.5! It's been in there since early betas and has never been fixed. Slowly my trust in firefox is vanishing and with this performance I fear ie7 will make all the new firefox users switch the browser again. I for sure will if firefox does not stop to eat my memory like fruit cake!
Unfortuatly I can't actively add to the effort of fixing this bug, but I can share my encounter. What the attachment shows is a result of a 5 hour web comic reading spree, so i guess i wasn't really taking it lightly on Fx. The memory was released once firefox was closed and reopened. I have after this experience set my disk cache, under options, to 5mb; also I have set Browser.cache.memory.capacity to 5120 (5mb). Hopefully this will keep future over-bloats to a minimum - but so far it seems with every page loaded, regardless of how many tabs are open, firefox takes another meg or so. Firefox is currently on just over 40,000Kb, and usually opens around 20,000. If this isn't fixed soon, I may go and do something rash - like acclimatize myself to opera.
I am looking around Bugzilla to find anything that talks about the good ol' "memory leak" from JPGs has been reopened. I just did a bit of a test and open a couple pictures. FF and SeaMonkey quickly grow to 200+ megs of memory and VM size in Windows. It seems like the memory is not being released when the tab is closed. Closing the browser frees up the memory as expected. The interesting part is that I had left FF open for a few days of browsing and it went up to 700 megs of memory and 1.5 GIGs of VM. Bug 319262 seems similar (if not the same). Doing a search for memory on Bugzilla seems to show a bunch of recently filed bugs for memory leaks.
I've been reading a few of the bugs and it looks like adblock may have been my problem. I'm testing it out.
closed all tabs except for 1 that was all text and it didn't let go of much (if any) of the memory. Extreme case, loaded up a bunch of graphically intense pages, etc...
(In reply to comment #27) > Extreme case, loaded up a bunch of graphically intense pages, etc... Can you write up the steps to reproduce?
Load up firefox - starts at 28,544(physical) and 19,296(virtual) on the firefox start page http://antwrp.gsfc.nasa.gov/apod/calendar/ca0512.html Right click on the pictures and open in new tab Go to each tab, and click on the picture to open just the .jpg files No excessive memory usage is shown as each picture is in its own tab... I opened 3 rows of tabs and didn't see anything major. So you can close all these. Now go and load each of these on its own tab (these are the last handful of Fark.com photoshops) http://forums.fark.com/cgi/fark/comments.pl?IDLink=1875193 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1873835 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1872776 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1872358 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1871580 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1870884 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1870784 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1870507 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1868625 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1868604 http://forums.fark.com/cgi/fark/comments.pl?IDLink=1868601 My memory usage hits 500MB very quickly. Closing the tabs in firefox gets me from 500,000 and 500,000 back to: 75,884 and 66,440. Which is still quite a bit over the 28,544 and 19,296 we started with. Some pages seem to release memory and some don't. These all release MOST of what they've consumed. I'll try and find some that don't. On a side note: All of these same pages loaded in Opera 8.5 and Opera.exe uses 40,684 and 52,196. If I minimize opera, with all tabs still open it now uses 12,324 and 52,408.
You can't expect memory to go back to what it was when you started. The fact that memory did not go back to what it was at the start does not indicate that Firefox didn't release memory. Trying the steps you describe with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060124 Firefox/1.6a1, leak-gauge shows no objects leaked. Memory was 19 MB at the start and 59 MB at the end, with 26 MB of the extra 40 MB accounted for by the normal growth of the memory cache. Perhaps the other 14 MB was some sort of leaked objects leak-gauge doesn't detect, or perhaps it was legitimate memory usage. I find this test inconclusive. If you can show that with each page you load, the extra memory grows higher and higher, that would be an indication of a memory problem. The amount of memory Opera uses isn't relevant to this bug. You can try to find another bug about the memory cache exceeding its limit or about a more efficient way to store images. It's a legitimate complaint, but isn't what this bug is about.
I read online comics, and I find that when I sit down to read a new web comic, starting at the start of the archives, firefox's memory use contiues to increase, none of it appears to get released, and I only ever have one tab open as I'm only reading one comic. So heres a test: sit down for 5 hours and read a web comic with a large archive, (something positive has a massive archive), always clicking 'next comic' and never opening more than one tab. See if memory EVER gets released while doing this.
(In reply to comment #31) > So heres a test: sit down for 5 hours and read a web comic... Could you give a specific URL to try?
I see... "Something Positive" is the comics I should try. Going to http://www.somethingpositive.net/ and repeatedly clicking on the Previous Comic link certainly does make memory usage keep climbing higher, in SeaMonkey (with an old profile) but not in Firefox (with a new profile) on Windows XP. Can you try this after creating a new profile and see if the problem still occurs, and also mention the browser and version and operating system you're using?
To all comment posters after Comment #19 on 2005-11-25(after Firefox 1.5) : - You all are better to read thru Bug 320915(1.8 memory leak campaign) and see dependency tree of Bug 320915. To all comment posters of comment of "suspecting memory leak" in comment #0 to comment #18 : - See Bug 320915 Comment #28 and install new tool of "leak-guage". - Can you see some apparent undestoyed objects even when no extention?
Reproducible: Always Steps to Reproduce: 1. Go to http://www.somethingpositive.net/ 2. Scroll down the page and click on the Previous Comic link 3. Repeat step 2, and every 20 or so pages, stop and view the memory usage When I did this, I saw memory usage increase every time I viewed it. The strange thing is that while you're watching the memory usage, it continues to climb upward even through the browser doesn't seem to be doing anything. After about a minute, the memory levels off, and the next time you check the memory usage it does the same thing. The memory usage appears to grow without limit. If you don't see the memory use grow upward at first, just watch it for at least a minute and see if it starts to climb. The way you scroll down the page makes no difference. I've used the mouse wheel, scrollbar, and keyboard navigation. The number of pages you visit in between checking the memory usage doesn't seem to matter -- it is reproducible with opening just 1 page and checking, or opening 30 pages and checking. I've reproduced this problem with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060128 Firefox/1.6a1 and SeaMonkey trunk build 20060128. I have no additional extensions or themes. The leak gauge reports no objects leaked. The maximum capacity of the memory cache is never exceeded. Turning of bfcache seems to have no effect. Opening a new tab after the memory usage has grown releases only a tiny amount of memory. I've been able to get Firefox to consume 300 MB of additional memory doing nothing but the steps above.
I also see this in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060201 Firefox/1.5.0.1, freshly installed with a new profile. I'm adding this to the Firefox 1.5/Gecko 1.8 memory leak campaign.
Blocks: mlk1.8
Assignee: jag → general
Severity: normal → major
Status: ASSIGNED → NEW
Component: XP Apps → GFX
Product: Mozilla Application Suite → Core
QA Contact: pawyskoczka → ian
Whiteboard: see comment #35 for steps to reproduce
Here's some steps to reproduce a similar problem: 1. Go to http://www.iccomics.com/chapters/prologue/index.php?id=1 2. Click on the Next button 3. Continually view the memory usage in Windows Task Manager The memory usage shows a similar pattern to what's described in comment #35, but as I start browsing more pages after I've paused for the memory use to go up, the memory use starts going back down again. What's causing the delayed growth in memory use to begin with, and why is it dropping in this case and not dropping when browsing http://www.somethingpositive.net/ ?
This bug report seems like an attempt to file one bug for all memory leaks. That's useless. If that was the way we worked, we'd have about ten bug reports in the system, seven of which would be: Mozilla uses too much memory Mozilla crashes Mozilla displays pages incorrectly Mozilla is too slow Mozilla behaves incorrectly Mozilla has bad user interface Mozilla has security holes and none of them would ever get fixed. There's a good reason we have, and want, one bug report per fixable problem, and that we thus have more than ten bug reports in bugzilla. I don't see why this was moved to the GFX component, and I'm marking it invalid. See http://dbaron.org/log/2006-01#e20060110a for what makes a useful bug report on memory use.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
But please do file separate bugs on specific problems like the one described in comment 35.
please post a link to that bug here once filed.
Well, the original bug report was about a bug that showed up specifically in Mozilla 1.4 on Mac in 2003. But that was never addressed, so I agree the bug is no longer useful. Anybody here with a working test case should go file a new bug with their specifics. Several folks here have developed good test cases. Thanks to all for your hard work on this, and make sure to file new bugs so that work stands a chance of being not in vein. Oh, and if you _do_ want to track the grand "Mozilla uses too much memory" bug (what this became) go over to bug 320915 and move your vote over there if you want. Sure, it's a hundred thousand bugs after this one, but this is now a dup of that, and it's done right. ->VERIFIED
Status: RESOLVED → VERIFIED
I've filed bug 326611 for the issue reported in comment #35.
No longer blocks: mlk1.8
Keywords: mlk
Whiteboard: see comment #35 for steps to reproduce
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: