View Full Version : Firefox memory usage
Randall
01-27-2006, 08:21 PM
This Mozillazine article, Reducing Memory Usage (Firefox) (http://kb.mozillazine.org/Reducing_memory_usage_(Firefox)), is giving me some ideas. As many here will know, memory consumption has been my biggest complaint about Mozilla and its progeny. First on Windows, then on the Mac -- which means I can't blame everything on the OS's memory management.
People who shut the browser down every day probably don't run into these problems, but I can have a dozen web pages open for days at a time. It all starts adding up after a while.
One of the first things I looked at was browser.cache.memory.capacity (http://kb.mozillazine.org/Browser.cache.memory.capacity). It's supposed to cache about 22MB of data in memory on a 512MB system. But when I typed about:cache?device=memory into the address bar, I got this: Number of entries: 1503
Maximum storage size: 22528 KiB
Storage in use: 140472 KiB
Inactive storage: 0 KiB If the max storage is 22MB, then why is it using 140MB at the moment? :eek:
As I understand it, the memory cache is supposed to supplement the disk cache (76,800KB max, 76,769KB in use), not cache images from a site I visited a week ago. Why is it keeping 2MB jpegs in memory and 2K gifs on disk?
Good grief. No wonder Firefox is using 257MB of RAM (and another 1.4GB of virtual memory) right now. :rolleyes:
So first I'm going to turn the memory cache off altogether (browser.cache.memory.enable (http://kb.mozillazine.org/Browser.cache.memory.enable)) and see if that makes a difference. Reclaiming 140MB would be a nice start. There may be a cost in performance -- but performance ain't so great as it is.
I'll update this thread as I learn what works and what doesn't, in case it proves useful to someone. Maybe I'm not the only one who shuts the browser down once a month. :wink:
Randall
The major difference for me was installing the Flash blocker plugin. That was 99.99% of my resource issues right there.
Dan
Melissa
01-28-2006, 01:10 AM
memory consumption has been my biggest complaint about Mozilla and its progeny.Mine too. Well, that and with Firefox when one window has to close due to an error, it takes the whole shooting match down with it (not just that window). I really wish each window would run as a separate process. I have been using that SessionSaver extension that the article mentions though and, most of the time, it works pretty well.
I've also noticed issues with the later versions of Adobe Reader, and have gone back to using 5 because of it. Blah. Maybe I'll try upgrading to the latest like they say...or maybe not.
I'm also a user like you, Randall, in that I always have multiple windows/tabs open (understatement) and put off restarting Firefox just as long as I can (sometimes to the point of where it just decides to it for me...%)).
I've suspected a memory leak...it just doesn't seem like Firefox releases the memory properly at times...and I see the article specifically addresses this as well, so will have to look closer at it.
I've pretty much learned to accept its "shortcomings" up til now as the alternatives just won't cut it, and it just doesn't seem like it's any "one" thing doing it...making it really hard to nail. (Who knows...maybe the problem is my expectations...lol)
Anyway, thanks for the article and I'll be watching to see what helps you as well. :)
I've also noticed issues with the later versions of Adobe Reader, and have gone back to using 5 because of it. Blah. Maybe I'll try upgrading to the latest like they say...or maybe not.
The latest is by far the worst one yet. Previous versions ran pretty smoothly for me in Mozilla and Firefox, but 7.0 is insanely bad. I try to avoid PDFs now. Edit: I see there is a 7.0.5 now, but I'm not brave enough to try it.
I've suspected a memory leak...it just doesn't seem like Firefox releases the memory properly at times...
That's what I was seeing, as well, but it was almost entirely due to Flash. I had pages taking up several hundred MB of memory that wouldn't release due to the Flash content.
Dan
Randall
01-28-2006, 02:15 AM
The major difference for me was installing the Flash blocker plugin. That was 99.99% of my resource issues right there. Yes, I have that as well -- it's practically a necessity on my Mac, because a site with one or two Flash ads can push my CPU use to 100%.
Anyway, follow-up on the cache question: Disabling the cache seemed to have a positive effect on memory use, but I didn't spend enough time with it to know for sure. That's because Pandora (http://www.pandora.com) stopped working. :eek:
Back to the drawing board...
Right now the cache is only 7MB, down from 11MB when I started writing this post -- but it's supposed to be 4MB according to the limit I set with browser.cache.memory.capacity (http://kb.mozillazine.org/Browser.cache.memory.capacity), as suggested in that article. I'll be keeping an eye on it.
Meanwhile, something besides the cache is eating RAM, because I'm maxed out again. Maybe it's Pandora, which started working again when I re-enabled the cache. The fact that it's a Flash app should give Dan a chuckle. :wink:
Randall
Randall
01-28-2006, 02:35 AM
Yeah, it was Pandora. Shutting it down freed almost 200MB. :hrmm:
Maybe I'll plug my headphones into the Dell and run Pandora from there...
Randall
Melissa
01-28-2006, 02:44 AM
The latest is by far the worst one yet. Previous versions ran pretty smoothly for me in Mozilla and Firefox, but 7.0 is insanely bad. I try to avoid PDFs now. Edit: I see there is a 7.0.5 now, but I'm not brave enough to try it.Oy, I think I'll hold off on this as well. I guess that old "if it's not broken" thing applies... (I've also gotten conditioned to avoid PDFs.)
That's what I was seeing, as well, but it was almost entirely due to Flash. I had pages taking up several hundred MB of memory that wouldn't release due to the Flash content.I scaled back on the extensions to only those I felt I really didn't want to live without...mainly because I wasn't sure if one was conflicting with another and causing some of the problems. Never been a major user of extensions anyway, but will give Flashblock another try. Thanks for the input. :)
Melissa
01-28-2006, 02:47 AM
Yeah, it was Pandora. Shutting it down freed almost 200MB. :hrmm:Yikes. Haven't been running Pandora tonight (since restarting Firefox earlier). Think I'll run it on my other machine (and add Flashblock to this one) and see what happens... I know it's not the entire cause of my problems (heh, where do we start), but am sure it doesn't help matters. :(
Melissa
01-28-2006, 02:52 AM
...add Flashblock to this one...The only trouble is that means I gotta restart it *again*...lol (whine)
Hey, I put off installing Flash for several months because I hated the thought of closing the browser. But once I determined (through help here) that Flash was the cause of most of the problems, I installed the blocker plugin right away... That's the only plugin I run currently. My previous Firefox installs were hit or miss with completing plugin installations, so I got into the habit of ignoring their availability.
Dan
I've also noticed issues with the later versions of Adobe Reader, and have gone back to using 5 because of it. Blah.
I'm going to mention this (http://www.aota.net/forums/showthread.php?postid=142663#post142663) again, because I still think it's such a great tool. The amount of times I'd click on a link and then groan because I'd inadvertently opened a pdf and now had to wait the eons for Acrobat to load up all it's libraries. Now they get treated like any other file, and if I choose to open it, it opens instantly.
Snarpy
01-28-2006, 08:27 AM
Regarding the memory issues in Firefox that you guys are talking about ....there's always Opera (ducks and runs...)
works for me
kitchin
01-28-2006, 10:28 AM
The more good browsers the better! As for Firefox, I suspect running bad or incompatible extensions is the source of most problems. That's indeed a Firefox bug, but at least you can fix it by disabling some extensions, if you have any.
Acrobat 7 made one improvement: you can use the search button. That was broken in Acrobat 6 inside the browser. And Acrobat 6 took forever to load. With 7, the slow-down is not in loading Acrobat, but in loading the document. Sometimes the entire Firefox browser freezes up until the PDF downloads. Small PDF's are no problem. So every click on a PDF is a gamble. That needs to be fixed... or set it up to view the PDF externally, like Adam said. Today for some reason I can't recreate the problem. Maybe it's a memory issue. IE has an advantage: it shows the download progress on the status bar. But in both browsers the window sort of hangs in a half-rendered state.
I don't how the Firefox memory thing will work out. The codebase, or size of the code or whatever, for a browser seems to be really large. I guess a browser is more complex that it seems. With Mozilla, the coders are untangling a lot of old stuff. And working on new features. There are definitely some screaming meanies on the Mozilla forums saying they -- the developers -- should stop all development and work exclusively on bug-fixing, and memory bug-fixing in particular.
Firefox runs fine for me usually. Maybe I don't visit a lot of difficult sites. For me, anyway, the crashes have gone down with every version. Phoenix 0.3 crashed all the time! I'm running some kind of build between 1.5 and the upcoming 1.5.0.1. No crashes at all. Maybe because I got tired of most of the extensions. IE View is essential, I always install that for everybody's computer, since plenty of pages require ActiveX or use weird IE-only stuff. I also have the Spellbound spell checker and Webdeveloper extensions.
Wow, I just installed Foxit, and that little bugger is instantaneous. And it loads in a separate window like it should (never could figure out how to get Acrobat 7 to do likewise; worked in previous versions).
Dan
Randall
01-28-2006, 11:35 AM
I'm going to mention this (http://www.aota.net/forums/showthread.php?postid=142663#post142663) again, because I still think it's such a great tool. The amount of times I'd click on a link and then groan because I'd inadvertently opened a pdf and now had to wait the eons for Acrobat to load up all it's libraries. I do need to try that one. I used to disable the browser integration because of crashes (just rename every copy of nppdf32.dll you can find, Dan), but that hasn't happened in a long, long time.
If you want Adobe Reader to open faster, disable most or all of the plugins in Acrobat 7.0\Reader\plug_ins. Loads in a flash. Regarding the memory issues in Firefox that you guys are talking about ....there's always Opera (ducks and runs...) Yeah, yeah. But it feels weird, even on my Mac. Firefox is a couple generations removed from Nescape by now, but it's still familiar. Opera (and Safari, for that matter) are just too jarring.
Insane as it sounds, if I had to give up Mozilla I'd be using IE. :dunno: There are definitely some screaming meanies on the Mozilla forums saying they -- the developers -- should stop all development and work exclusively on bug-fixing, and memory bug-fixing in particular. There's a 3-page article in Information Week about user discontent, The Trouble With Firefox (http://www.informationweek.com/news/showArticle.jhtml;jsessionid=SPICP4D4D0A1KQSNDBOCKH0CJUMEKJVN?art icleID=175800132&pgno=1) -- and they're talking about 1.5, not some obsolete pre-1.0 beta. (Version 1.5.0.1 is supposed to address some of the problems.) As for Firefox, I suspect running bad or incompatible extensions is the source of most problems. That's indeed a Firefox bug, but at least you can fix it by disabling some extensions, if you have any.
If I start seeing memory problems again that aren't related to Flash or the memory cache (still under 10MB, but we'll see what it looks like two weeks from now), I'll have to take a hard look at my extensions. There's no Safe Mode icon with the Mac version, so you have to go to the command line and run it this way: /Applications/Firefox.app/Contents/MacOS/firefox -safe-mode Randall
sheila
01-28-2006, 01:59 PM
Maybe I'm not the only one who shuts the browser down once a month. :wink:
You would not be the only one. However, I don't use FF (as you know). I find Opera's memory leaks in this area to be minimal (especially compared to that of FF).
Mandi
01-28-2006, 08:06 PM
Oh, I missed the pdf reader thread earlier . . . I have a client for whom that may be perfect. She's got a mangled Adobe install that will neither repair, nor uninstall :blah: . . .
Randall
01-29-2006, 02:40 PM
I've got Pandora running in Safari, just to see if it's Flash in general or just Flash in Firefox that's eating my Mac's RAM for breakfast.
Interesting that it signed me in automatically. Can't be tracking users with cookies -- something in Flash itself?
Each new song grabs 5-10MB, plus a variable chunk of virtual memory. And it's cumulative -- which really sucks when you consider that their license agreement with the record labels doesn't let us go back and replay a song. Why's it still in RAM if we can't access it? :grr:
Have to watch and see if it just goes up forever or hits a plateau. Sometimes it frees up some memory on a song change, but less than the new song is taking.
So I guess I can't blame this one on Firefox. Any Pandora users seeing this kind of behavior on Windows?
Randall
Randall
01-29-2006, 05:23 PM
After peaking at 150MB, Safari has settled into the 110-130MB range, possibly because it couldn't steal any more RAM from the other programs I'm running. Virtual memory has been rising inexorably -- it just passed Firefox in that column -- and it's still using twice as much real memory as any other program.
Pandora (or Flash in general) is a monster. :eek:
I'll try to keep both browsers open to see how they compare over longer time frames.
Randall
Andilinks
01-29-2006, 06:06 PM
Opening Pandora in iRider adds 24 MB, it runs @ ~105 MB with only Pandora open. New songs don't change this, nothing accumulates. It has played about 6 songs now, no change... I do use FF but never opened Pandora there. I guess I won't.
edit: I don't think any devils emerged as I opened Pandora either. That's odd.
Andi
Pandora ... is a monster.
I don't think any devils emerged as I opened Pandora either.
I assume the irony is intentional and evident to all?
Dan
PaulKroll
01-29-2006, 09:08 PM
Yes, of course, we all know Pandora is the giant chinese bear that played Elizabeth Montgomery's mother on "Bewitched"
And here's another "Yea FoxIt!" vote.
Randall
01-29-2006, 09:44 PM
I don't think any devils emerged as I opened Pandora either. That's odd. You're just listening to the wrong kind of music. :EG:
I left Pandora on pause for a while, but the memory usage is creeping up again.
In any event, all I've proved so far is that Dan's right -- Flash can be a colossal resource drain in Firefox, and apparently in Safari too.
Randall
# I don't do ironing
Andilinks
01-30-2006, 02:15 AM
You're just listening to the wrong kind of music. :EG:You would think that somewhere between gangsta rap and Christian Rock there would be at least one evil worthy of Pandora.
Melissa
01-30-2006, 03:58 AM
And here's another "Yea FoxIt!" vote.Ditto! Very nice. Thanks for bringing it up again, Adam. (And, thanks to ryount as well.) :)
Randall
02-06-2006, 03:38 AM
Safari was eating gigabytes of virtual memory by now -- it's been running (or paused) for over a week now, so I probably haven't gotten the benefit of the 2.1 upgrade yet. :wink:
But after I got an alert from Flash that the script was becoming unresponsive and should I let it continue (which I did), VM had dropped down to 75MB.
Now if only there was a way to manage the plugin's memory usage by hand...
Randall
Randall
02-12-2006, 08:58 AM
I've got Pandora running in Safari, just to see if it's Flash in general or just Flash in Firefox that's eating my Mac's RAM for breakfast. Well, I can tell you that running a Flash app like Pandora continuously for two weeks is not for the faint of heart. Safari would give up some physical RAM when I needed to do other things, but eventually it was just dragging the whole system down with it. When I shut it down (took several minutes to do so) this morning, it was holding onto 100MB of real memory -- Firefox has been known to eat more than that -- and a whopping 2.5GB of virtual memory.
From now on I conduct my Pandora experiments on the Dell. :blah:
The original purpose of this thread -- looking for ways to cut down memory usage in Firefox -- went by the boards as I had to shut it down periodically to free up some memory for something else. So I do not yet know if 1.5.0.1 has improved on the memory issues. I'll keep it running for a while and report back.
And after waiting fruitlessly for 1GB DDR prices to drop -- they've actually gone up -- I finally ordered the upgrade (saved a few bucks because it was on sale). If I were buying a Mini today, it would be cheaper to get the 1GB to begin with. But Crucial's price is still cheaper than what Apple was charging at the time (http://www.aota.net/forums/showthread.php?postid=136357#post136357), so I can't complain.
Randall
Evoir
02-14-2006, 02:33 AM
yep, you can always just get more ram. :)
Randall
02-14-2006, 09:20 PM
The memory should arrive this week, and I think I've found a putty knife that'll do the job. :yeah:
Randall
Randall
02-16-2006, 12:48 PM
Call me crazy, but at 11:30 last night I sat down with my Mini and several putty knives, struggling to get the case open. Which it did, and I suddenly have twice the memory I used to have. :smile:
Putting it back together proved to be the hardest part. It's still not perfect -- the back of the case is a real @#$% to line up -- but it works and the USB ports are OK, just a little looser than I'd like.
Now we'll see how Firefox behaves with all that extra RAM, and what I can do with the leftover 512MB module.
Randall
Melissa
03-03-2006, 07:17 PM
Randall,
Do you normally have Gmail open in one of your tabs? I do and I'm finding that ppl are mentioning a connection between Gmail (javascript) and the memory/CPU issues of Firefox.
Quite some time ago, I also noticed that our Service Desk software would cause some serious resource issues for me if set to auto-refresh so I disabled it. But I don't believe there is a way to disable (or adjust) the auto-refresh in Gmail...
Heh, in looking around a bit, it appears that Gmail has caused some similiar issues (and more) for some Opera users as well. Maybe we should be cussing Gmail more than Firefox... Then again, maybe not... :ytthink:
Anyway, might be something worth looking at... :dunno:
Randall
03-03-2006, 08:10 PM
Do you normally have Gmail open in one of your tabs? I do and I'm finding that ppl are mentioning a connection between Gmail (javascript) and the memory/CPU issues of Firefox. No, I'm just using Gmail for archival purposes at this point. I do go in occasionally, but I don't stay there very long. Heh, in looking around a bit, it appears that Gmail has caused some similiar issues (and more) for some Opera users as well. Snarpy tells me that she's using Firefox for Gmail now because Opera wasn't getting along well with it. But she also says that Opera never crashed on her, unlike Firefox. She lost parts of a long email she was working on today (Gmail's autosave caught most of it, I gather) when the browser went "poof" on her. :sad:
Maybe it was the javascript thing.
I've got Firefox running with the bare minimum of extensions right now -- Tab Mix Plus, Web Developer and Flashblock -- and I'm keeping an eye on its memory usage. At the moment it's only using 83MB of physical RAM, but we'll see what it looks like a week from now. (I've read that you can't put too much stock in the virtual memory figures in Apple's Activity Meter, so I'll ignore that for now.)
Randall
Randall
03-12-2006, 01:15 AM
At the moment it's only using 83MB of physical RAM, but we'll see what it looks like a week from now. It's been a week and a smidgy. One open window, two tabs, and the browser is using 137MB. :hrmm:
The memory cache is using 43MB (ten times more than it's supposed to), but that can't explain all of it. Looks like it's time to run this puppy in Safe Mode and see how it behaves.
Gonna have to steer clear of Flash-heavy web sites, with no Flashblock running...
Randall
If I avoid problem sites, Firefox usually runs at about 110-130 MB with 10-20 tabs open for weeks on end. It's pretty darn steady as long as I stay away from Flash.
Dan
Randall
03-12-2006, 03:53 PM
If I avoid problem sites, Firefox usually runs at about 110-130 MB with 10-20 tabs open for weeks on end. What I'm not sure of is whether I'm getting any of that memory back when I close most of the tabs. I need to pay more attention to what it's using in various situations. So to start with, I launched it in Safe Mode and came straight to this thread. It's using 42MB at the moment. After I post this, I'll restart it in normal mode, and repeat the steps that brought me here. That'll give me baseline numbers for both modes.
Edit: no significant difference, so it'll be a question of how it behaves over time.
I'll make notes on RAM usage, number of tabs and time since the last restart. If I find a pattern, I'll report it here.
More likely, it'll be all over the map and I'll have no idea if anything I'm doing makes a difference. :hrmm:
Randall
Mandi
03-13-2006, 06:49 AM
What utility are you using to calculate RAM usage?
Randall
03-13-2006, 08:34 AM
What utility are you using to calculate RAM usage? OS X has an Activity Monitor that tells you the same sort of info the Windows XP Task Manager does. (The Mem Usage column in Task Manager isn't visible by default, and I think it was the same with Activity Monitor.)
Mainly on account of Firefox, I keep the processes list sorted by RAM usage most of the time.
Randall
Mandi
03-13-2006, 01:21 PM
Ah, I see. I thought that was probably it. I use another utility that reports similar functions, CodeStuff Starter (mostly I use it for the handy Startup registry editor) - Starter consistently reports 1-2 KB MORE memory use per application, than Task List. (It also doesn't leave off processes like Task List seems to.)
Is that significant in this sort of tracking, or is it just a peculiarity among different utilities, do you think?
Randall
03-13-2006, 01:44 PM
Is that significant in this sort of tracking, or is it just a peculiarity among different utilities, do you think? Who knows. I've already learned that the VM figures in OS X are misleading (it's more like a theoretical maximum or some such thing than what's actually in use, and the numbers always go up, never down). So the best we can hope is that we're in the general ballpark, unless someone has done a detailed study of this.
Task Manager says Firefox is using 72MB, SysInternals' Process Explorer says 77MB. :dunno:
Randall
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.