12 ms·
Firefox finally plugs the leak
- deleted 15y ago[deleted]
- AndrewDucker 15y agoWell, plugs _a_ leak. The Memshrink team has plugged an awful lot of leaks, and slimmed down an awful lot of code over the last year or so. They've now hit the point where they're largely fixing bugs in add-on writer's code, rather than their own.
- corin_ 15y agoIs that actually the case, or is it that the leak they've fixed is related to the add-ons API? I've only really glanced at the patch discussion thread, and this isn't an area I understand all that well anyway, but the way it reads to me is as the latter - hopefully someone can explain why I'm either write or wrong on that, though.
- AndrewDucker 15y agoSo far as I understand, there was a change made which cut off a leak between add-ons and the tabs/windows they were attached to, so that closed tabs weren't being held in memory just because an add-on had a reference to them. However, that change broke something in earlier versions of the Add-on SDK, which means that at least one Add-on was then leaking memory like crazy. Upgrading that add-on to the latest version fixed _that_ leak. More here: http://blog.kylehuey.com/post/21892343371/fixing-the-memory-leak http://blog.kylehuey.com/post/21892343371/fixing-the-memory-...
- lillycat 15y agoThey did both. The leak was in numereous add-ons code, but they were able to change the semantics of the API to remove all these leaks. But that breaks things in some edge cases, but that was deemed acceptable (one time fix in some extensions, mainly those using Jetpack needing to embed the latest versions).
- khuey 15y agoActually it's looking like most of the breakage can be avoided by a simple change on our side.
- pbiggar 15y agoVery true. There's been a massive amount of work put in by the MemShrink team. But it looks like they've found the holy grail this time; look at the numbers: 800MB vs 230MB. That's a big big deal.
- diminish 15y agoAt my Linux firefox I am seeing better and better performance, thanks the team.
- rrreese 15y agoThis sounds great, I stopped using Firefox just over a year ago due to its fairly heavy memory usage. I usually run with 20+ tabs and even on a machine with 4GB of ram it was pretty unpleasant. How are you current Firefox users finding the RAM usage, especially compared to Chrome?
- lillycat 15y agoSince months (I would say Firefox 7), Firefox is better than Chrome when used with a lot of tabs.
- robin_reala 15y agoI’ve just killed and restarted Firefox, then duped my current set of tabs over to Chrome (in-house jukebox using websockets, a slideshare presentation, couple of open Google Docs spreadsheets, a Pivotal tracker session, a couple of tabs of a local development project, Google Plus, and this HN thread). Totalling up ‘Real mem’ in Activity Monitor shows Chrome 18 using 735.4mb (of which 33mb is Flash). Firefox 13 (beta release to be fair) is coming in at 450mb (of which 65mb is Flash). The internal memory measurements (about:memory) come out as 835mb resident for Chrome, and 324mb (of ‘explicit’, whatever that is) for Firefox. I’m not using any extensions in Chrome. In Firefox I’ve got installed Firebug, FireFontFamily, FireQuery, Lastpass, PDF.js and QuickJava. Edit: oops, missed cloning a tab with a video in over to Chrome. That explains the disparity in Flash, and you could probably expect to increase Chrome’s real mem usage a little had I not closed it already…
- corin_ 15y agoThis bug fix won't make much of a change right after starting Firefox, it just prevents memory from building up over time due to closed tabs. Additionally it's effective in nightly builds not beta, so 15.0a1 not 13. Your comparison is useful overall, but not relevant to this change.
- robin_reala 15y agoRealised that after I posted. Still, as you said this shows that Firefox has come a long way since the 4 days.
- bmurphy 15y agoJust because you have 16gb of memory doesn't mean you won't ever swap. Firefox is not the only application running on a computer. My working set is routinely over 7gb and I have 8gb on my laptop. A goldfish will grow to full its bowl. If I had 16gb, I know I could use it. Every little bit counts.
- StavrosK 15y agoReally? How? I'm currently coding and browsing the web and I'm only at 1 GB, out of 2. Sure, the VM isn't on, but that's still another 500 MB.
- darklajid 15y agoI don't understand what surprises you. The memory load depends in large parts on the work requirements, I'd guess. 2 weeks ago I went from 4 GB to 8 GB (still would love to have more) here at work, because 4 didn't cut it and lead to lots of paging. Visual Studio (often 2 or 3 instances, grabbing around 300-500 each) MS SQL Server IIS OCR Engines (depending on load) With Windows 7 as host (already not a slim OS) this killed my productivity with 4 GB, especially if (to get back on topic) I opened my beloved Firefox...
- justincormack 15y agoSame here but from 8 to 16 on both my desktops. Huge improvement under Windows, less under Linux with SSD. Working habits vary, but I multitask a lot.
- samspot 15y agoIn my stack eclipse + tomcat hits up to 1300mb, plus leaky firefox with another 1gb, and windows and everything else at about 1.5gb. 4gb is barely enough.
- LogicHoleFlaw 15y agoI've easily burned through 8GB of memory when I'm crunching numbers on large-ish datasets in Octave. (And through twice that when I had a bug in said Octave code...)
- ck2 15y agoSo every extension built with the SDK version before 1.6.1 is suspect. That's a whole bunch of extensions.
- khuey 15y agoThat appears to be a bug in the approach we're using, and we think we have a fix for it.
- mistermann 15y agoThis is great news. Any estimate on when these fixes might be released into a production version?
- khuey 15y agoWe're on track to ship this in late August.
- mbrubeck 15y agoIt actually turned out to be only SDK versions older than 1.4, which account for fewer than 500 add-ons (including only about 100 that are "fully reviewed" and are displayed in search results): http://bugzil.la/751466 http://bugzil.la/751466 And not all of those 500 add-ons will be affected, since it only affects add-ons using specific APIs from those old SDKs. And if the cause of that leak is fixed soon, then only users of Firefox Nightly builds will ever have been affected.
- acqq 15y agoAccording to the article, they plugged one leak but opened another, which appears as soon as you have a simple Add-on made with, so typically, Mozilla's own "Add-on SDK."
- khuey 15y agoThat's just a bug. It will be fixed (there's even a patch in https://bugzilla.mozilla.org/show_bug.cgi?id=752877 https://bugzilla.mozilla.org/show_bug.cgi?id=752877)
- wazoox 15y agoAll of my machines have only 2GB of RAM. On the Linux boxen, I have absolutely no trouble running firefox with 50 tabs, OpenOffice and Gimp at the same time. I don't monitor FF memory usage, because there isn't any significant problem. On the other hand on the MacBook I must restart FF regularly, else over 700MB of memory the application gradually slows down and "beachballs" regularly. I don't know what's wrong exactly, because I have all the same extensions.
- cheald 15y ago> All of my machines have only 2GB of RAM. Out of curiosity, why? You can get 16GB of DDR3 for under $100 these days. The upgrade from 4GB > 16GB and an SSD were huge productivity boosters for me. When you stop worrying about memory management (from a consumer perspective), things are so much snappier.
- kaolinite 15y agoIf he doesn't need it, why spend the extra money? :-) It may be cheap but if it's just going to sit there being unused then why bother at all?
- wazoox 15y agoActually I built these machines with parts I had lying around. As I only had 1 GB RAM sticks (and 2 RAM slots), well 2 GB I have. But as I said, I have quite fat systems and for what I need (text editor, xterms, firefox, a little LibreOffice and GIMP from time to time) it doesn't make any meaningful difference. A few months back I had a 2004 vintage machine with 1GB of RAM and the main annoyance was that firefox was quite long to start up in the morning, and that's about it. Ah, and spamassassin was a tad slow, too, meaning that my emails needed a few minutes more to fetch in the background, no big deal. I switched because the graphic card failed and I hadn't any AGP card anymore :)
- kbolino 15y agoTo be fair, on modern systems, memory doesn't just "sit there being unused", especially if you keep the system running for a while. Memory not used by running processes will be filled with cached files from disk. Adding additional memory can result in significant improvements, depending on your workload and other hardware. Whether it's worth the money is a personal decision, of course. It sounds like the GP doesn't use an IDE for development; I've routinely filled up 2GB even on relatively small projects just with Eclipse.
- yuvadam 15y agoMozilla has been making outstanding progress in decreasing Firefox's footprint. At least from what I can see on the beta channel, things are getting much better, every single day. Props.
- btipling 15y agoOn Sunday, using my latest version of Firefox, I opened a single page loading it only once to check how it looked in Firefox. Then I forgot I had Firefox open for the rest of the day. Eventually my Macbook Pro became slow and looking at Activity Monitor I saw Firefox was taken hundreds of MB of RAM and just eating some 20-30% of CPU% just idling there. Every time, Mozilla devs claim all the bad bugs will be fixed in the next version. I heard it for v2, for 2.5, 3, and 3.5 and now of course whatever crazy version number Firefox is on now. It still sucks, but now I don't care any more because now I have Chrome.
- jlongster 15y agoSomething is obviously wrong there, and as seen in many other posts in this thread, that is not the case for most people these days.
- astine 15y agoI heard it for v2, for 2.5, 3, and 3.5 and now of course whatever crazy version number Firefox is on now. And each time Firefox has gotten more stable than the last. It's pretty snappy now and I can run it for days on end with no problems. Also this patch hasn't been applied yet.
- rpearl 15y agoEvery time I use Chrome, my Macbook Pro becomes slow and everything pages to disk. It's snappy when it starts, but in Chrome 20 or whatever crazy version number they're on now, there's still a lot of leaks. It's very frustrating. But for some reason everyone has the impression that Chrome is both fast and uses less memory than Firefox, when the evidence points to the speed difference being anywhere from minimal to completely unnoticeable (I recently read a paper which suggested that Chrome's JIT optimizations have a negative effect on overall performance due to their expense). Furthermore, Firefox uses substantially less memory in general. Extremely effective marketing on Google's part.
- invisible 15y agoV8 is ACTUALLY fast and has been for years. I don't know how that could even be contested. Mozilla internally knows that v8 was/is fast and has been trying to beat them. Chrome does use more memory if you have a ton of tabs open, but it also is still fast. I haven't noticed a substantial amount of memory leakage, but I guess that depends. Regardless, the memory leakage can be subdued by reopening a tab rather than reopening the app. The marketing that Mozilla puts out is the problem, not Google's marketing. http://arewefastyet.com/old-awfy.php http://arewefastyet.com/old-awfy.php http://arewefastyet.com/ http://arewefastyet.com/
- driverdan 15y agoI applaud the MemShrink team for their effort in finally fixing FF. Forgive my ignorance but why are these leaks possible in the first place? Shouldn't the browser manage and constrain plugins (sandbox?) to prevent issues like mem leaks from even being possible? I understand the high level description of the patch but I don't understand why this wouldn't have already been part of FF's plugin management system. It seems like a pretty basic and core concept.
- mccr8 15y agoThere is a tradeoff between how powerful addons can be and how much they are sandboxed. Firefox errs on the side of letting the user control their browsing experience. This patch reins in addons a tiny amount to eliminate a very common source of addon leaks.
- kibwen 15y agoRemember that Firefox was originally intended as a minimalist platform, with the expectation that users would use its extension mechanism to build it up according to their needs. As a result, Firefox's extension mechanism is quite liberal. The upside is that its extensions are capable of much more than, for example, addons in Chrome. The downside is that extensions are responsible for much more, and can touch basically any part of the program (which is why powerful addons are so prone to breaking with new versions of Firefox: they're effectively targeting an unstable API). Chrome addons are less prone to breakage and mischief, because Chrome addons target a stable API with a limited set of functionality. Firefox introduced just such an API last year, called the Jetpack API (it may have been renamed since then). You can tell if an extension is using the Jetpack API if it doesn't require a browser restart to install.
- driverdan 15y agoI assumed it was something along these lines, thanks for making it clear.
- Erunno 15y ago"You can tell if an extension is using the Jetpack API if it doesn't require a browser restart to install." Not necessarily. "Traditional" extensions can be extended to support being restartless as well if they implement the necessary hooks.
- srean 15y agoThis is great news and may finally push me into upgrading FF on my depleted box. Despite all the grumblings about FF's memory issues, it is the (only) full featured browser that works for me, not Chrome. There are a few reasons for that. (1) There's no tab abuser worse than me. I have hundreds of them around (I have commented before, why I have it that way) (2) I do all my browsing from a (battery less) laptop with 512 MB of RAM. (3) I do not close my browser for months on end. On top of that I expect that I should be able to do my usual editing etc while I have the browser open. For this very corner'est of corner cases, if I use Chrome, my box goes into a fetal position and dies. However, and kudos to FF 3.6, (yeah 3.6!) my laptop works great, no problem at all. I have flashblock, no script, bar-tab, memory fox, bunch of greasemonkey scripts (to fix google's layout, and give github and bitbucket a dark theme) and have tweaked FF's cache settings. On a more performant box I am on FF-11, but have never upgraded on the other, fearing that the new FF assumes (not unreasonably) the box to have more memory.
- mburns 15y agoWhy not spend a few dollars and double or quadruple your memory?
- srean 15y agoI can send you my routing number if you have a few to spare :) But a larger point is that I disagree with the trend of using more hardware for doing less but taking the same quantum of running time , especially so when there are easy non-onerous alternatives. Much that anyone may want to manage my expenses, doing it this way frees up money that I can spend elsewhere, where I am more keen. This box of mine is not worth spending more money over, but useful enough that its a loss if I junk it.
- leptons 15y agoGet a real computer or quit your bitching.
- aboodman 15y agoIn the post, the author addresses this: ...what if the user has a high-end machine with 16GB of RAM? Then paging isn’t an issue. But this improvement will still be a big deal on such a machine. This is because garbage collection and cycle collection cause pauses, and the length of the pauses are roughly proportional to the amount of live heap memory. (Incremental garbage collection will soon be enabled, which will result in smaller garbage collection pauses, but there are no plans for incremental cycle collection and so cycle collection pauses will still be relevant.) So even on high-end machines with lots of RAM, leaks can greatly hurt browser performance.
- systematical 15y agoBetter late than never, but you leaked more than just my system memory...you leaked your own market share.
- Erunno 15y agoYeah, hopefully this will not go down in history as another too little, too late effort. Firefox still has a sizable market share of about 20%-25% (depending on the source) so Mozilla can still flex some muscle to keep the web open. I dread the day when only cooperate players are left to decide about the future of web technologies. I wonder how the situation would look today if the MemShrink and Snappy projects had been started in 2009 or 2010 at the latest. My gut feeling tells me that the loss of market share and especially mindshare wouldn't have been as dramatic as it is today. Oh well, I'm happy that Mozilla apparently got their act together and taking the competition more seriously. Right now it's fun looking forward to each next Firefox version. :-)
- zobzu 15y agoIts hard to say. Bu where Chrome made the most impact is probably not the geeky community, but mr everybody. And how? => link on google.com telling you have to get Chrome => bundling+force install+defaulting Chrome when updating acrobat reader, flash, etc, even from Firefox or IE. Both work fine as long as Chrome is a decent browser (and Chrome is a very decent browser that's for sure) They stopped the later and still do the former (it doesn't necessarily show up in all situations so your mileage will certainly vary), any time you go on Google.com with any browser. At least the former is not morally wrong, but it certainly has a huge impact due to their near monopoly on search, and people believing that Google is the Internet and if Google says something, they should probably do it. I don't think Mozilla could beat neither of those 2 points, even thus they could have lowered the overall impact by doing things better (especially their switch to 6 weeks release without having silent update/auto addon compat, that one was just plain dumb).
- Erunno 15y agoYeah, there are probably several factors which assisted Chrome's rise to prominence. Obviously Google's huge marketing power and their bundling deals can't be disregarded easily but in the end Chrome is also a great product. It's fast (real and perceived performance), it has a remarkably polished primary UI (though some of the secondary UIs like history are rather suboptimal) and has neat features which only get slowly adopted by the competitors (e.g. ingenious tab closing behavior, built-in translator, built-in PDF reader, etc.). So great product + good marketing = success. And the importance of geek/early adopter/enthusiast users shouldn't be underestimated because these are the ones who often have wide reach (e.g. journalists, bloggers, etc.) or are responsible for how web technologies are used (e.g. developers). It's a bitter lesson the non-WebKit browsers vendors had to learn after most mobile web developers started to target only WebKit because that's the devices/browsers they are using on a day-to-day basis. And in its early days Mozilla thrived on the free guerrilla marketing provided by enthusiast users, not just in their immediate private space but also in magazines, on websites and other outlets where users and authors were constantly praising Firefox for its security, speed and features compared to IE6. Today that place has been mostly taken over by Chrome. I still having a hard time wrapping my head around how badly Mozilla handled the appearance of Chrome for years. The threat was so obvious from the very beginning and not just in hindsight. As I said, I have the impression that they are on the right track now but there must be lessons to be learned from the 2008 to 2011 period for Mozilla itself and other organizations in similar situations. I wish Mozilla higher-ups would sit together and publish a retrospective about what they perceive they did right and wrong.
- marklindhout 15y agoPfew... 230 megabytes for a running browser. Not long ago that was all my workstation had!
- goggles99 14y agoAlmost an identical title to this one 10 months ago... SMH Mozilla May Have Plugged Firefox's Memory Leak Once and For All Posted 07/06/2011 at 8:36am | by Paul Lilly http://www.maximumpc.com/article/news/mozilla_may_have_plugged_firefoxs_memory_leak_once_and_all http://www.maximumpc.com/article/news/mozilla_may_have_plugg...