Firefox Memory Usage »
First, while I do create some software, I am not what should be called a developer. I don't have the experience.
With that out of the way, it seems to me that Firefox (1.0.3) is using up a decent amount of memory on my (Windows XP) system. When it first starts, it uses perhaps 18MB. Within just a few minutes, it's at 20MB - not a huge jump, but a jump nonetheless.
Earlier today I noticed that things were running slowly and I fired up the Windows Task Manager. Firefox was using over 120MB. Now I had not logged off or even restarted Firefox in probably a week. I just leave it running. I also had probably 15 tabs open.
As I started closing the tabs, the memory usage really didn't change. There may have been some adjustement, but nothing significant. This would normally lead me to believe that tabs don't matter much, if at all. When I finally closed Firefox, that memory was released. Starting up again, it's now back around the 20MB figure.
It's certainly possible that something on my system is ill- or mis-configured and causing the problem, but I'm not sure where I'd even look, as the memory appears to be allocated to Firefox alone. It could, perhaps, be the Bloglines Toolkit (or some other extension), but short of uninstalling it I'm not sure how to test that (I will uninstall it to see if it helps). And more specifically, if it is the issue, I'm not sure how to address it.
So I'm wondering if any of you have seen similar behavior, either with or without the Toolkit or other extensions?
Update: In a quick test, I disabled the Toolkit notification, then disabled the extension entirely, so it should not be running. Firefox appears to periodically add 8K or so to the running memory, even without the Toolkit. I'm not sure what this is, only that it does appear to happen from time to time. It doesn't appear to be the Toolkit, though, and for that I'm grateful.
Then I started testing. A fresh load of Firefox, using the local paper, started at about 21MB. This size varies a bit depending on the size of the page you load, but seems to be relatively consistent if I load the same page over and over again for testing.
In any case, those values seemed consistent. So I started adding tabs. I chose this article, just because I happened to find it interesting. Using the Firefox "Page Info" option, it shows the page as 11K. When opening this page as an additional tab (leaving the front page in the other tab), the memory usage jumps up by about 3MB. Opening another tab with the same size results in sizes of 1.4MB to just over 2.0MB for each tab opened.
Those are reasonable numbers - I have no problem with the size in general, as I typically only have a few tabs open, so the footprint is still small - about 31MB in this example, after having the front page and five copies of the article open at the same time (6 tabs total).
The problem seems to come on closing those tabs. I closed all five of the articles, and the memory savings was just over 1MB. So while opening those five tabs added about 10MB to the memory used by the application, after closing those five tabs, just 1MB was released, leaving a net gain of 9MB for no effective difference after closing those tabs!
Update: For comparison purposes, I tried the same test in IE (using windows instead of tabs, of course). The first window was smaller than Firefox - about 19MB compared to 21MB. Small savings, but interesting to note.
The next window added nearly 13MB of memory - all the way up to 32MB, which immediately places it higher than Firefox with all 6 tabs open. Each of the final four tabs required 1-2MB, for a final footprint of just over 38MB. So it ends 8MB higher than Firefox. If you open a ton of tabs/windows, then this could be a reasonably significant number.
Then I started closing windows. By the time I was back down to a single window, I was running with 23MB - just over the initial size. So while IE added 19MB of memory to the running instance, it also released all but 4MB of that after the windows were closed, and perhaps more importantly, the total size after closing those extras was just 23MB - compared to Firefox at 30MB.
Opening the extra windows again resulted in a higher memory footprint at the end, but it still seems that IE is releasing most of the extra memory used, while Firefox is keeping it. More as I play with it some more.
Update: After observing this behavior for a couple of days, I can say with certainty that Firefox does not immediately release the memory in use by those extra tabs, while IE does (for windows). However, it does seem that Firefox will release at least some memory periodically, as I have seen an instance of Firefox go from 100MB to 80MB with absolutely no change in the number of tabs (or even the URLs open in those tabs). So I'm not sure how, but it does seem to free up memory from time to time. Just not immediately.





















Comments (32)
There is a technical term for that. It's called being a pig. I thought only Microsoft apps were pigs. Run SQL Server. It'll eat its way through most of your RAM up to 2GB. It'll actually steal from the OS. But you can restrict it.
Posted by Ted on April 24, 2005 10:12 AM
I don't know if you have already done this, but I'd suggest raising a bug for Firefox. I'd like to think that they'd fix something like this if they got complaints...
Posted by Paul Moore on April 25, 2005 4:56 AM
Do a Google search and you'll see this is an issue for many folks. There's some suggestions for setting the cache size that helps, but in general you'll still find problems. Just as a guess, I'm going to bet that at least one of the pages you visit uses a lot of JavaScript. Possibly even Gmail. If that's the case, the culprit is likely the page your visiting, and not Firefox's (at least not directly). Google on Mozilla and JavaScript leaks and you get the skinny on what I'm referring to. That said:
Mozilla should find a way to resolve the JS leaks. Yes, it's technically an issue with the page and not the browser, but the browser's GC shouldn't be allowing this to occur in the first place. Difficult thing to fix, but they need to put some emphasis on it. IE has similar issues, but it seems to have far less "in practice" problems with this, for what ever reason.
It's my experience that Mozilla's products have several leaks beyond the JavaScript leaks. Not as bad, certainly, but they need addressing as well.
Posted by Me on April 25, 2005 4:16 PM
I've noticed the same thing on my computer. I'm running 1.0.3 on XP. I have a dual athlon 1900 w/ 512M RAM.
Usually FF gets to around 120M during the course of my normal browsing, but sometimes it uses more, and I have to end the process. I just tried changing the ram cache setting to 16000. I managed to get memory usage up to 80M by opening 15 tabs. When I minimize this tabbed window, it goes down to around 10M instantly, and climbs back to around 30M in the next few seconds. When I maximize the tabbed window, it climbs to around 40-50M. I clicked on each tab to make sure each site was loaded. It went to around 60M. Next I closed each tab, and with one tab remaining it used around 40M. I just loaded 13 bookmarks into tabs, and it is still around 40M.
From my short informal tests, I think lowering the memory cache has reduced overall memory usage when using tabbed windows. Minimizing a window that is using memory seems to release some memory. What I am curious about is why Firefox would cut it's memory usage in half simply by minimizing and maximizing a window. Clicking on each tab is very responsive, much more so than when it was using 120M.
Perhaps Firefox should run the garbage collection routine periodically, freeing memory from tabs that haven't been viewed in a while. The installer should set the memory cache based on the amount of system RAM.
Posted by Brandon on April 29, 2005 7:01 AM
"Just as a guess, I'm going to bet that at least one of the pages you visit uses a lot of JavaScript." Agreed. And "Mozilla should find a way to resolve the JS leaks" is rather thoughtful, but indeed hard to implement. Ah, surely I'm not one of the Mozilla developers, so maybe some day it could be fixed:)
However, monitoring the memory usage and leaks of a page's javascripts may result to eating more memory and CPU usage, because that's not an easy and costless job, just take a look at java.
Meanwhile, besides javascripts, Flash and big moving pictures are eating your RAM, too. Some months ago I found that the "modern" flash movies costs too much to display, and often I found them only ads at last, so I installed 2 extensions: FlashBlock and NukeAnything. Hope they can do something on your browser:)
Posted by IUSR on April 29, 2005 8:49 PM
Javascript could indeed be causing issues. Flash as well. And I use FlashBlock. I love it. The problem is that it still loads the flash. It just doesn't display it. I'm sure there is some memory savings there, but it's not like the flash is completely non-existent...
In any case, I have some memory chips on the way, so it won't be an issue for long.
Posted by Chad Everett on April 29, 2005 9:05 PM
Good luck, then...
Hope we are lucky enough to avoid loading those flash movies once and once again...
Maybe you can improve FlashBlock?:^)
Posted by IUSR on April 30, 2005 10:59 PM
This problem has been bothering me for a while and I've found no good resolution. I started to suspect my PC was the problem until I did some googling.
Posted by Andrew Lawlor on May 19, 2005 10:46 AM
FF uses so much memory on my system. Within an hour of surfing the net I can see it choking my computer. FF is good, but this is a BIG issue for me that needs to be resolved. And yeah what's with the startup time? IE opens up much more quicker.
Posted by Nahel on May 21, 2005 4:22 AM
Same problem here, it's a memory hog. I think FF developers should take care of this problem (optimizations) before adding new features, which just gonna make it worse.
Posted by Son Nguyen on June 1, 2005 3:22 PM
The reason IE opens so fast is because in a sense it's always running. Look at your running processes and you'll see explorer.exe running all the time. Thats a big part of IE and also a big part of Windows, which is why IE can't be uninstalled (atleast not officially) from Windows.
Posted by Nick on June 2, 2005 1:39 AM
Go to about:config, create a new integer browser.cache.memory.capacity which will limit RAM cache to the specified value (in kilobytes). Restart browser to see its effect. After doing this, the memory usage also seems to drop considerably by minimizing the firefox window...
Posted by Amit Chakradeo on June 9, 2005 1:57 PM
And after all this time I thought I was the only one?!
Posted by Tek on June 13, 2005 1:04 AM
Haha seems i have the record, firefox used around the 290 MB on my system. It looked like it has something to do with the download manager.
Posted by Christiaan on June 13, 2005 4:16 AM
Christiaan, I'm really sorry but I just broke your record. 428MB is what I got with only 4 tabs open, all on the same site. I started from scratch and visited no other sites besides Google, which is my home page. The site has no external links, no ads of any kind, no java, no scripts, no flash, just plain html with jpg images. I'm running 1.0.4 on Win XP Pro with 1GB RAM. I'm gonna try the tweak suggested by Amit and see if it helps.
Posted by Jynx D5 on June 15, 2005 1:44 PM
I've been experiencing similar problems with FF. When first loaded it has a relatively small footprint, but as windows are opened it quickly bloats up to around 70-80MB (of the 512MB) in the computer. Minimizing all FF windows causes this to instantly drop down to 5MB or less which then quickly climbs back up. Something special is happening when a window is minimized and I'm not entirely sure what. But I'd like for FF to use a more reasonable amount of space (or at least hold onto a consistent amount of memory for the given loaded pages).
Posted by Daniel Mullowney on June 19, 2005 3:32 AM
Firefox has a bad memory leak. There is no work-around, other than to close all browser windows and start over.
Unfortunately, well-intended people keep posting a bogus fix that involves setting browser.cache.memory.capacity to 16 MB. It simply doesn't work.
I wish the Firefox builders, bless their hearts, would listen up, track the problem down and fix it.
Posted by Peter on July 1, 2005 10:47 AM
Running Firefox on Linux for the past few days, it just hit over 1 GB - yes, GB - in memory usage. That's not even adding the X server memory it uses. I'd say I was running about 10-15 tabs. It really seems unacceptable to me, I hope something can be done!
Posted by Thomas on July 10, 2005 3:05 AM
Try turning off prefetching:
Open "about:config" and scroll down to "network.prefetch-next" and double click the line so the value on the right says "false".
Seems to cut FF's memory usage for me down to a more reasonable 30M, instead of 130M.
Didn't old Mozilla have a memory cache size setting? Why didn't FF keep this?
Posted by Keith T. on July 14, 2005 2:08 PM
what i dont like is that firefox is running and so is iexplorer at the same time. fire fox is at 20 megs right now but iexplorer (which i dont have any ie windows open) is running at 15 megs and there is another ie running at 7 megs. now ff is at 20 megs (cuz i opened this comment window). why is it that ie is running when i have no windows open!
Posted by koolman on July 16, 2005 1:09 PM
This is not perfect but it ALWAYS works (on Windows)... get Firefox Preloader. It is free. It preloads Firefox into memory, and puts a handy icon in the Notification Area (by the clock).
When Firefox has blasted away at your RAM, and you have already closed all Firefox tabs and windows and the RAM is still being used, right-click on Firefox Preloader, select Reload Firefox, and sure enough it automatically kills the process and reloads Firfox into RAM -- using minimal memory.
You also get the benefit of Firefox Preloader -- it loads MUCH faster!
Posted by jp on August 3, 2005 1:16 AM
I watch my computer like a school nun with a bull whip and a bottle of gin and I must say I feel increasingly concerned about the memory issues (whatever they may be) with Firefox. I have the same stuff open in Opera and it's not even touching 6mb while Firefox is just over 30. The GUI and key extensions (adblock for example) are what make Firefox my browser (other then testing purposes). I'd like to see this resolved myself but I barely know serverside web programming. I do know if you want bad code go to 99.9% of the websites on the internet.
JAB
Posted by John A. Bilicki III on August 31, 2005 12:23 AM
Same problem here on my gentoo amd64 system. 250MB and more in use by FireFox. Only restarting FireFox will free the memory.
It is a big problem, i have only 512MB atm, and HD-Swap slows down my system in al little while.
But i am sure, the developers will fix this problem soon.
Posted by christian hofmeister on December 11, 2005 4:09 PM
You should learn about virtual memory a bit. What you are looking at is only part of the picture - physical RAM usage. Virtual memory consists of 'pages' of memory in both physical RAM and in the swap/page file. You can add to task manager a column indicating the amount of page file; simply add the 'Virtual Memory' column. This amount + physical RAM usage is the true amount of virtual memory the application is using. This is how Firefox 'releases' memory suddenly - it is paging it out to the swap file, not magically freeing it. Anyway, too much to describe here, please do research so you know what's up. I don't disagree that Firefox's virtual memory usage is excessive, I just wanted to clear things up.
Posted by jcollake on January 19, 2006 5:32 AM
Here is one (at least temporary) fix to get FF (and all of your other programs) to release a bunch of your memory:
http://www.majorgeeks.com/download.php?det=2913
It is a program called Ramfreer, and basically it (in my very non-technical description) steals all of the unused RAM into its own program (you can see this by looking at Task Manager at the same time as running it), and then releases it all. It is the only way I can keep my laptop running for weeks on end, I run it every day or two.
With FF, it seems to free all memory that has been grabbed and not released from closed tabs and windows, and temporarily releases memory grabbed in current windows. But the second you use FF again ... oops, there goes your RAM again. Hope it is useful to somebody. Cheers
Posted by SEM on February 6, 2006 12:49 PM
Having seen the list of memory "problems" with FF, I like to ask: is anyone experiencing REAL memory problems, i.e. increased swapping activity of the OS and/or application slowdown - or are you all just looking at the task manager's process list?
I would be surprised if anyone is experiencing memory shortage due to FF usage.
The reason is that FF's memory allocation strategy tries to utilize as much unused RAM of your computer for in core page cache as possible. When other applications are eating up free RAM, FF releases pages from its cache to satisfy those applications. I.e. FF's in core cache is never swapped out to and reloaded from hard disk. So no memory problems.
This is intelligent memory usage. You do not want unused ram. Unused ram does not serve you anything.
The minimum resident memory footprint of FF is around 8-9 MB (while open) - that is below the memory footprint of a fresh opened IE. It almost completely removes itself from the core if minimized.
Posted by scnt on February 7, 2006 9:44 AM
Good points, to be sure. And since I've upgraded to 1GB of RAM, I don't have problems even though FF is regularly at 300MB or more.
But at 512MB and below, Firefox used up enough that other applications started slowing, presumably because of increased page file swapping.
Also, I rarely minimize things - it's quite possible that this strategy alone could help. I just don't often take the time to minimize something - I just pull up something else.
Posted by Chad Everett on February 7, 2006 9:55 AM
One small note about folks wanting to block flash: you can actually insall "AdBlock" then just add a filter for any file with a .swf extension, and it'll do that. From what I've read, AdBlock actually gets the plain HTML page, and before loading images or anything else, checks for ads, so this means it would block the flash before downloading it.
If you have the Filterset.G updater, that might be a problem, since it may override the flash blocking rule you define when you do an update. I wouldn't know for sure, sinceI've found JavaScript to be far more the problem.
Also, if memory is really that critical, you COULD disable JavaScript alltogether. It's actually an option in the options window you can check. It actually works with GMail, too, if you use the "Plain HTML" view, but GMail won't let you chance your GMail Options in the Plain HTML view. Just a thought ;)
Posted by StarFox on February 15, 2006 12:20 AM
"is anyone experiencing REAL memory problems, i.e. increased swapping activity of the OS and/or application slowdown?"
YES! My computer has 256MB of RAM, and when Firefox is open, I sometimes have to wait for 20 seconds for things to be paged in and out. Windows pops up error messages saying it needs to increase my virtual memory size. Once I close Firefox, everything is fine. If Firefox uses some sort of adaptive technique to free the memory cache, it is very broken.
If you minimize any Windows application, the memory usage drops drastically. I don't know if this is due to programs being swapped out to virtual memory, but I would guess that it has to do with the Windows memory manager, not with the application.
Not all of us have the resources to go out and buy a new RAM chip so that we can run bloated programs.
Posted by bw on April 28, 2006 5:26 PM
Definitely firefox eats up memory like no tomorrow. The moment i kill firefox rest of my apps seem to get a new life. Opera is definitely sleeker and faster. When i open firefox its like ok here i go i'm taking this bulky truck for a city drive while opera is like a spin in a german sports car. Now only if the web was as strict as opera.
I'd rather looking at the cyber world thru the windsheild of my sports car. the truck can go to hell....
Posted by darx on May 6, 2006 8:46 PM
Sure it is a memory hog but there are just so many damn useful extensions for it... Gmail encryption, tabmix, web developer, adblock, noscript... After I did some of the about:config configurations I generally keep firefox inside the 60MB-150MB section, but this is not bad considering i have 1700MB of ram.
The reason why I will not go with Opera is because the interface is so damn ugly, and I am obsessed with my bookmark toolbar on firefox. The way it displays my rss feeds are fantastic, and I love my favicons in the bookmark toolbar.
IE is just a mess period, and the live toolbar and Maxthon seem to have sluggish performance with their tabs. Even though I do like some of the live toolbar features one in particular is like a research type extension...
It would be fantastic if Firefox could do better, but in the mean time it will do...
I just noticed however with the configurations to my Firefox, when I minimize Firefox it goes from 30mb to 2mb... WOW. This is with 68mb VMsize.
Posted by David Patrick on September 26, 2006 3:36 AM
I dunno about anyone else, but my computer has FF 2.0.0.6 goes from 20mb start, easily up to 124,000 K in just minutes, with no additional tabs opened.
Posted by Bobby on August 5, 2007 7:56 PM