Mozilla MemShrink Set To Fix Firefox Memory
darthcamaro writes "If you're like a lot of Firefox 4 users out there, you've probably noticed that Firefox has a serious memory problem — it uses more than it really should. At long last, Mozilla developers are finally set to take this issue seriously with a dedicated team called MemShrink that are focused on the problem. 'It's pretty clear by now that this is a much bigger problem than any one person can likely tackle,' Mozilla Developer Johnny Stenback said."
Any gains they make will be eaten up by the rapidly increasing version number.
...for one post-hoc team to fix after the rest have gone on a rampage. Still, I suppose it's better than not having such a group.
Live today, because you never know what tomorrow brings
I do not mean to sound like a troll, but it seems all browsers are consuming more and more memory. Chrome being the worst (due to every tab being sandboxed?), Safari is equal to Firefox.
Why is memory usage increasing so much in recent years? Firefox is currently consuming 450MB on my machine with only a few tabs open.
Don't be a Chrome Clone, make the next release Firefox 4.1.
I love Firefox. I don't think it takes too much memory. Sure it could use more but its not so bad. Right now for example its using 128M (after being open for days) on a 4G machine which is fine.
Bundle in MagnaRAM with Firefox.
Firefox desperately needs to lower its memory usage. I've been using FF4 for a while now, and it's using 200MB. It's gotten so bad that I installed an addon to provide easy restarts - twice a day or so, I reboot the browser.
Yes, 200MB would be fine if the computer was just being used for web browsing, or even just office stuff. But I use this machine for gaming a lot - a a recent convertee from Chrome, I'm used to being able to start up a massive memory-hog game without needing to close out my browser.
That sounds about right, for the first week or so, if you only have 10 tabs open. Try 25-30 tabs, for a month, and it's much larger, especially if you've visted a few poorly-designed webpages. (Though to be fair, I find that poorly designed webpages have obvious markers, like one I recently timed at seventeen seconds(!) before I could scroll down... and if I leave it open in a tab, eventually crashes the browser (although that takes a couple of days)).
If they could prevent a bad script or plugin from taking the whole browser with it, that would be great.
It really needs a way to see a list of what scripts and plugins are running, what resources each is consuming and the ability to kill them individually.
A list of currently open tabs would also be good, especially if it also had a history list for each tab (bonus points for making it editable, with drag and drop, etc.).
"Is life so dear, or peace so sweet, as to be purchased at the price of chains and slavery?" - Patrick Henry
What memeory problem? It uses 150MB when just browsing with a few tabs open, I've stress tested mine with 10 tabs of videos, pages and flash. It never passes 250MB.
Who even has that little RAM still, let alone uses firefox like that?
My browser has been open for about 2 days, I have around 20 tabs open (no video sites, though I'm sure a lot of the pages have Flash ads)
It's currently using 2200MB of virtual memory and 1100MB of real memory.
That doesn't include the 289MB/123MB used by the Flash plugin container.
10 tabs is kindergarten for serious browsers. The problem from what I can tell is with people who have A LOT of tabs open for a long time. Remember not everyone shuts down their computer each night, some people keep Firefox instances running for months.
Also even if it only uses 250MB that is unacceptable if that is more then it actually needs to use. If everyone followed the "people have heaps of memory so don't worry about minor memory leaks" then we would quickly find our abundant memory filling up. Memory bloat and "just reboot" are never acceptable.
========
CINC, 4th Penguin Legion
They closed the memory leak bug with wontfix. NOW all of a sudden they care about memory? Yeah, I'll believe it when I see it.
Just because you're paranoid doesn't mean they aren't out to get you
The good news is, the team has produced a plugin that reduces the browser's memory footprint to 25 Mbytes.
The bad news is, the plugin takes up 300 Mbytes.
Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
Firefox uses massive amounts of memory, but it's not as bad as Opera which I'm starting to suspect has a serious memory leak. On my system at the moment - Window 7 ultimate 64 bit with 6Gb memory, Firefox is using 336Mb, but Opera, with less pages open, is up to 445Mb and it's using 4% CPU in the background too. I used to use Opera a lot, but increasingly I'm relegating it because of this issue.
OTOH Chrome seems to be becoming increasingly frugal over how much it uses.
FF had memory issues a DECADE ago.
http://groups.google.com/groups/search?hl=en&ie=UTF-8&safe=off&q=firefox+%22memory+leak%22&btnG=Search&as_mind=1&as_minm=1&as_miny=1981&as_maxd=1&as_maxm=1&as_maxy=2003&as_drrb=b&sitesearch=
Out of curiosity, why so many tabs? Unless it's a page that will look different if you reload it, and you need to see what it was like the last time you looked, can't one just bookmark the page and open the bookmark instead of the tab? And if you already have a bookmark, just close it?
That way, the tabs won't hog memory and CPU.
Yay, it only took 5 years of bitching for them to actually look into it instead of blaming addons or your profile.
Your hair look like poop, Bob! - Wanker.
I noticed this problem with Firefox and bought tons of RAM for both my Windows 7 64-bit and my Ubuntu-64 machines. Weirdly, they don't take full advantage of the extra RAM and I still get sluggishness as these programs appear to be paging to disk. I therefore welcome this advancement.
PS: If anyone has tips about how to get more memory to FF, I would greatly appreciate it.
This is easily reproduced in FF4 when you load a page with lots of images. The mem tends to grow proportionally to the size of the images on the page. But this is the only scenariou where the mem usage is different from other browsers and needs looking into.
I think at least part of the problem is perception. Most people seem to have this mindset that using RAM is bad, and the more memory you have free and unused the faster your computer will be. These are the same people who think they're increasing their computer's performance by turning off superfetch, etc.The problem with this perception is that it's completely stupid.
Programs load data into memory because memory is fast and your disk and the network are significantly slower; hundreds or thousands of times slower, and pointlessly unloading the data from memory increases the risk of having to go back to the slower disk or network to retrieve it later. If you still have RAM available, it is actually detrimental to your system performance to free this data.
Now, when you're running out of RAM there is a problem, the operating system and applications should begin to free data that is the least likely to be useful in the near future to make room for whatever is needed at the moment. If Firefox has a problem it isn't RAM usage, it's that it isn't paying attention to global system memory levels and caching less aggressively when there is RAM pressure, and honestly I wouldn't know if that IS a problem because I have way more RAM than I've ever seen my computer manage to use.
As far as I'm concerned, Firefox could also use a DiskShrink team, although perhaps DiskPerformance would be more accurate. My site uses OpenAFS across several locations with 6Mbps to tie them together. The workstations run Debian squeeze with Xfce. It all works fine, but in the beginning we soon discovered that Firefox wasn't going to cut it. Although it was our preferred browser, even with its cache disabled it was too slow when the user volume, which contains the home directory, was not on the local file server. We ended up switching to Google Chrome, which is much faster in this respect.
I hope this isn't just targeted towards firefox. Thunderbird is an unwieldy beast of an email app as well. No good reason that checking my email should involve consuming 200Mb of memory.
ôó
I'm running the latest build of Firefox on my late 2008 macbook pro with 4 gigs of ram. Right now, the app is taking 800megs while utilizing 15% of my cpu. I'm running Snow Leopard with five tabs open. One is a 404. One is an xml view. One is xbox live with the silverlight disabled. One is Slashdot with the ajax turned off. And the final one is an image was I viewing. I have only a couple of extensions installed and I never open a lot of tabs. Five or six is my sweet spot. Once firefox exceeds 1 gig of ram it starts to peg my cpu to the point where I have to kill the process.
Maybe it's the mac build, but it really is terrible. right now, I use it because of inertia but I these days, I feel more like a babysitter.
It relieves me to see them finally taking this issue seriously but I wonder if it might be a little too late (in my case). I'm just sick and tired of being sick and tired with it.
Btw, it's now up to 865mb from when I started typing. Just switching tabs kicked it up to 890 and now 920. I'm not making this up. I've seen the same behavior on vanilla installs. It's hard to believe it's persisted so long. Lets hope we see from fruit from there team. 950 now. I can't access the status bar. Submitting this then closing down the process.
PS - Post preview it dropped to 730 although I still can't access the status bar.
My computer has 8 GB of RAM, and I don't use swap. Now, just because it has 8 GB of RAM that does not mean that I want Firefox using all 8 GB! I need some left over for Eclipse, Evolution, and the other memory-intensive applications I unfortunately need to use.
So I hope you can understand why I get slightly annoyed when I see Firefox consuming 7500 MB of RAM. It's clearly using that much due to memory leaks and sloppy programming. I know it's not due to aggressive caching or anything like that, because I haven't visited over 7 GB worth of pages since starting up Firefox about 10 minutes ago.
Firefox has a serious problem with wasting memory, and it needs to be fixed. It's as simple as that.
Firefox didn't even exist a decade ago.
Can you get your MemShrink guys to look at Nautilus and gnome-panel when they're done? :)
Firefox 4 usually uses about 900MB of RAM after running for several days. This is not acceptable. But flaws in Chrome keep me coming back to Firefox.
When are they going to do something about CPU utilization? Firefox very regularly pins the CPU (well one core of a processor anyhow, showing it's not multithreaded well) at 100%, sometimes after just a few minutes, to the point where I can't File -> Exit, forcing the use of either task manager (on Windows) or kill -9 (on Linux). I've even blown away my profile, followed the usual tips, and yet it still happens. Now I can understand blaming a poorly-coded extension, or a corrupt profile, but why does it consistently occur on both Linux and Windows (I haven't used Firefox consistently on OS X)? I can even understand blaming the Flash plugin, but if that were the case, why are Opera, Chrome, IE, Safari, and other browsers completely unaffected by this issue?
Firefox has been problematic since the 2.x days, and only just now they're acknowledging this. Better late than never, I suppose.
The Christian Right is Neither (Christian nor right). See: Matthew 23, Matthew 25, Ezekiel 16:48-50
With the 8 tabs I normally have open in FF, eventually the CPU usage will spike when I'm switching from one tab to another and it will lock up for several seconds. Looking at it with the task manager, it says Firefox (Not Responding). WTF is with that? I close it, reopen it, restoring the same tabs, and I'm OK for a while. Annoying. I tend to simultaneously use FF, Chrome and Opera on XP. FF is the only one with this problem.
"Do the Right Thing. It will gratify some people and astound the rest." - Mark Twain
I just closed Firefox. Let's open it back up again. It opens one google tab and is using 120 megs private bytes and 361 megs virtual according to Process Explorer. Not too bad.
Now let's open up 50 tabs, all for for http://en.wikipedia.org/wiki/Main_Page
After spinning for a bit, Firefox is now at 396 megs private and 717 megs virtual. Let's close 49 of the tabs. After letting it sit for a little bit it drops to 333 megs private and 717 megs virtual. Let's repeat that a few times without closing the window.
50 tabs open: 525 megs private, 839 megs virtual.
49 tabs closed: 466 megs private, 846 megs virtual.
50 tabs open: 660 megs private, 1002 megs virtual.
49 tabs closed: 596 megs private, 1001 megs virtual.
50 tabs open: 775 megs private, 1122 megs virtual.
49 tabs closed: 730 megs private, 1123 megs virtual.
50 tabs open: 906 megs private, 1252 megs virtual.
49 tabs closed: 839 megs private, 1253 megs virtual.
50 tabs open: 1002 megs private, 1339 megs virtual.
49 tabs closed: 937 megs private, 1338 megs virtual.
50 tabs open: 1105 megs private, 1438 megs virtual.
49 tabs closed: 1043 megs private, 1438 megs virtual.
So it took 7 iterations (about 350 pages all told) to reach the point where Firefox was consuming over a gig _each_ of private and virtual memory with just a single tab open. Now if i ever reached this point in normal usage of course i'd shut it down to free the memory, but under normal usage after going through that many pages i'd have at least a dozen tabs open to things that i was still using.
And remember that that was just 350 copies of the same page, the main page for Wikipedia, which i wouldn't exactly consider a memory hog.
This Space Intentionally Left Blank
you right... It has not been a decade, but it does have memory issues since the beginning of FF.
Up to Firefox 3.6, Firefox used less memory than other browsers. I'm sure Firefox has had memory issues, but then again, other browsers seem to have worse memory issues. All browsers also experience crashes and security vulnerabilities. The question is one of how severe the problems are, not whether or not they exist. If you read the linked articles closely, you'll note they are about issues new to Firefox 4. The memory issues have become more severe in the latest version. That's what the new MemShrink team will work on.
What a fool believes, he sees, no wise man has the power to reason away.
Please, don't remind me of X 10 and their pop-under ads for webcams.
There's no -1 for "I don't get it."
Big problem.When I start my firefox,it consumes over 240M.
What reason could you possibly have for keeping 20 tabs open for 2 days?
I don't have the same 20 tabs open today that I had open yesterday -- only 4 are pinned as app tabs and open continuously.
This was to be expected, the way they handle memory is completely broken.
They're in C++, they should use RAII and exceptions.
Instead they code like in C (with returns everywhere and no mean to clean up everything) but with a Java-like OO model that relies on garbage collection.
he problem is with programmers.
We all remember when every byte of ram used was worried about because RAM was a precious resource.
Now we have programmers who have drank the kool-aid of "Hey Ram is CHEAP and programer time is expensive.
Need another feature? Oh just compile is some humongous library that some other guy wrote that is so poorly written that not even the smartest linker can avoid linking in every dam line since every thing is interdependent on everything else.
This is objects gone insane. Need another property, another method, just pile it on, don't waste time refactoring the code so that you get what you need with the smallest footprint you can get.
Programmers need to re-boot their brains and start coding like memory is a precious commodity because it IS when everyone wants to have 100 tabs open in their browser, plus eclipse, plus gimp, plus this plus that plus the other and do all of this when re-compiling the entire Linux kernel.
Hey KID! Yeah you, get the fuck off my lawn!
Good luck to the MemShrink team. They've been needed for years.
Now, Mr. Mozilla, about that UnfuckUI proposal...
And not just 4, either. Firefox has leaked memory badly. I've a habit of opening many tabs at once, and I expect once I close a page I should see that memory freed at some point. I shouldn't think that's a hard thing to do. a friend and I first observed this back with the 2.0 releases.
Once one has more than a small number of tabs, firefox 4 is much better than chrome on my systems.
yeah, I have 8GB to use, but even on that I'm tending to prefer firefox 4 over chrome. Also, don't you hate how chrome bunches them up past the favicon so one doesn't know what they are?
Decade: 10 years
Initial Firefox release: November 9, 2004
This year: 2011
2011 - 2004 = 7
7 != 10
Change is certain; progress is not obligatory.
The problem with Firefox isn't the perception of using large RAM, it's that it is flat out slow. Sure it renders pages faster than IE but it seem to take the longest to open up even when still cached in RAM. In terms of speed IE and Chrome both beat it from pushing the button to displaying the same homepage.
Incidentally it also uses a bucket load of RAM. On my system it's not as bad as IE but it's better than Chrome. Is this part of the perception or a symptom of a larger problem that is flat out bloated code.
The perception that more RAM worse is true not because more RAM is worse, but because the applications that use more RAM are usually worse. There are plenty of examples such as image editing programs. Nikon Capture uses 900MB (300MB more than Lightroom) takes longer to start up, and is way slower to actually apply updated settings to images, so much slow that the speed made me seek out Lightroom as an alternative. Again is RAM usage a symptom of poorly written software or is there a legitimate reason to use this much?
With me it's never Firefox per se that does it, it's xulrunner and flash.
Computer's ground to a halt?
Hard drive paging like a mofo?
Why yes, xulrunner and flash are using 90% of all physical memory. Yet again. And I have flash-control plugins that only start the flash apps I say to start.
There is the problem of web sites too- one popular site generates mountains of of javascript garbage every times you
scroll. See for instance the bug 656347 in the mozilla database.
The site? Slashdot. Mozilla is not happy the way Firefox manages this, but relying on garbage collection
very time you push arrow down is bad.
Does this resolve your problem: 1. Type about:config in the address bar of Firefox 4 2. Scroll down to image.mem.min_discard_timeout_ms 3. Simply change the default value from 120000 to 10000 http://www.overclockers.com/forums/showthread.php?p=6882338
There was probably a time (a decade ago?) when they were coding for the lowest common C++ compiler denominator, which was a bit of a problem with all of the platforms they target. I have a feeling that this was a reason at one time why they didn't use some features of C++. Is this still a problem? Even Microsoft have come a long way with their ANSI compliance in this time, but what about weird proprietary compilers on some minor version of UNIX? I remember being shocked by the crapness of Sun's compiler for instance compared with even MSDev95 or or Visual Studio 6!!! Yes I know, sounds like a tall order :)
With all the addons and "skins" that people love about Firefox so much, they'll never get it to be a slim efficient browser. I was once a Firefox Zealot, converting people left and right, but I've learned my ways. The worst was their "Alt Download" "feature" where if you tried to Alt Tab within a second or two of clicking a link, it downloaded a file. So I had hundreds of "forum.cfm" files on several computers.
... been this biggest problem with Firefox, not just since Firefox 4. Basically the last usable versions (memory/speed wise) where Phoenix and Firebird in pre-Firefox days. Ever since then it has been a memory hog and a pain. Eventually I switched to Chrome which just feels faster and I only use Firefox to debug websites with Firebug.
Yep, that's on my Macbook.
Red to red, black to black. Switch it on, but stand well back.
Sorry I can't help more, but it seems that bug 660577 could be relevant to your problem: https://bugzilla.mozilla.org/show_bug.cgi?id=660577 (Image-heavy sites are slow and often abort due to OOM; regression from 3.6). Cutting down from 120 secs to 10 secs alleviates the problem... sometimes, depending on how much RAM you have.
2019 is going to be the year of Linux on the desktop.
There's no way I am going to start an "Internet adventure", meaning searching for news/stuff that require visiting sites that I have never visited before, without a full set of FF4 portable, AdBlock, Noscript, Ghostery Autopager, YetAnotherSmoothScrolling, Stylish and Hyperwords. This for me is the minimal gear for a safe and effective quest. As long as I can't do this with any other browser, FF remains my only choice.
Needless to say, for all daily uses involving well-known safe sites, I don't need all that armour and I often use lightweight browsers like K-Meleon portable with its brilliant Privacy/Proxy/Agent settings accessible on the menu, or the chrome-based SRWare Iron portable.
When the MemShrink team succeeds to tame memory use, it will work only for a clean FF. The addition of the above plugins will still make it a beast. So I will SFTU and wisely suffer the consequences of my choice.
Regarding MemShrink, I think the decision was made by realizing that we are experiencing the age of netbooks and tablets. On these devices with meager hardware capabilities and limited RAM, competitive snappiness requires either more memory usage, which leads to more disk I/O, or more CPU usage, which both reduce battery autonomy. Currently, Chrome-based browsers seem to be more adaptable to these device platforms. MemShrink might provide some solutions allowing to temporarily survive the competition, but my bet is that soon Mozilla will be forced to consider a new codebase, written from scratch and specifically targeting these devices and possibly mobile phones too.
Then you should be using a VM on your desktop, with 16gig ram, and another instance of FF there, and you can just remote desktop/vnc to it.
Then it doesnt matter how much ram your laptop has.
Liberty freedom are no1, not dicks in suits.
RAII worked in C++ even since pre-standard times. Indeed, all you need for it are constructors and destructors, which are quite fundamental parts of C++.
Exceptions were more of a problem, but you don't need those for RAII; managing resources with RAII works equally well also with return (or any other form of flow control and error reporting, with the exception of longjmp).
The Tao of math: The numbers you can count are not the real numbers.
Firefox is using:
Image (executables): 95,084K
Mapped File: 56,892K
Sharable Pages: 133,100k
Heap: 25,100K
Stack: 46,080K
Private Data (explicit mallocs): 205,280K
Page Table: 1,372K
Unusable (leftover area of explicitly allocated pages that were LESS than 64K): 9,440K
Only 10M unusable isn't bad on windows... (start inevitable trolling here) as the memory manager only allocates pages in increments on 64k
Any and all content posted above may be ignored, considered irrelevant, or otherwise dismissed.
In the meantime I'd love any pointers at all to where you can buy the systems they used for development and testing - apparently you can actually buy systems with infinite memory so you can do extensive testing and never notice firefox has a memory management problem.
Number of firefox crashes while typing this comment: four.
-- That grumpy BSD guy - http://bsdly.blogspot.com/
On my 2GB RAM linux machine, with 7 tabs open, Firefox having been open for about 6 hours, about:memory says
Memory mapped: 287,309,824
Memory in use: 237,087,826
Is that really unreasonable? Every other web browser I've tried gives similar numbers. Or are people just comparing to some ideal standard of 15 years ago where everything is supposed to run in 500kB?
I'd tell a UDP joke, but you may not get it. I'd tell a TCP joke, but I'd have to keep repeating it until you got it.
Mac OS (classic) had working soft references back in 1984.
What way exists that 1. actually works as documented in *BSD, Linux, Mac OS X, Windows 32-bit, and Windows 64-bit, and 2. can be reasonably abstracted across said operating systems? One example of violation of requirement #1: Win32 ignores GMEM_DISCARDABLE.
In the real world, we don't need hard realtime guarantees in the vast majority of situations.
But such realtime situations arise often enough even in home use (video playback, video recording, games) that we do need at least some mechanism for realtime guarantees in desktop PC and handheld operating systems.
435mb currently. One tab open to slashdot
Try the back button. Try History > Recently Closed Tabs. Try History > Recently Closed Windows. I haven't found any easy way to clear out the Recently Closed lists except to restart Firefox.
Mozilla Foundation Top 20 Excuses for Not Fixing Firefox Bugs
Originally posted 2006-09-08.
Slashdot no longer numbers HTML numbered lists.
Seems like this is a recurring theme at Mozilla that 'makes great bounds' but never actually gets things down to a sane level.
Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
Seriously, there's no reason NOT to have a lot of RAM right now.
Other than having already maxed the RAM slots on an older or Atom-based motherboard. Or what 10" laptop with "a lot of RAM" do you recommend?
with 4GB, a bare minimum these days for gamers
My gaming machine has 4 KB. (I can explain if you wish.)