Hacker News new | past | comments | ask | show | jobs | submit login
Firefox finally plugs the leak (blog.mozilla.org)
227 points by pbiggar on May 8, 2012 | hide | past | favorite | 107 comments



Well, 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.


Very 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.


At my Linux firefox I am seeing better and better performance, thanks the team.


This 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?


I’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…


This 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.


Realised that after I posted. Still, as you said this shows that Firefox has come a long way since the 4 days.


With Firebug installed, you most likely have JIT disabled http://antennasoft.net/robcee/2009/12/15/firebug-and-the-jit.... I would suggest you use a separate 'webdev' profile for such things (the inbuilt web console that is now in firefox is also getting there).


That was true in 2009 but was fixed in January 2010: https://bugzilla.mozilla.org/show_bug.cgi?id=534120#c52 (although it’s true that if you’re actively debugging scripts the JIT turns off - Firebug has the script panel off by default)


Incredible, I've been doing all my browsing for the past year with the script and console panels activated and had no idea that it was disabling the JIT for every page that I visited. Just turned them off, and I can't believe how accustomed I'd become to sluggish webpages. Thanks for the link!


Thanks, that's great to know, time to give the latest FF another go.


If you haven’t done so already, it’s probably worth killing your old Firefox profile and starting completely anew.


> How are you current Firefox users finding the RAM usage, especially compared to Chrome?

I'm fairly sure that multiple studies have shown that Chrome uses more RAM than Firefox. But that's not what's important - all that matters is whether the browser appears snappy to the user. That's much more so the case with Chrome than it is with Firefox.


That's correct. Snappiness is what really is important. Mozilla conduct a parallel project called Snappy to improve that specific metric.

Note that Memory consumption is somewhat related to Snappiness: if it is too high, the program will slow down (paging, longer garbage collecting pauses, ...) and feel less snappy.


Assuming the system’s not paging.


I don't think memory's the bottleneck on most modern systems, so it seems like Google made the right choice by allowing greater memory usage in return for better end-user performance.


You're right in that Google's made excellent engineering tradeoffs to keep Chrome snappy, but note that memory is, sort of, the bottleneck on modern systems. Specifically, the channel between memory and the CPU:

http://en.wikipedia.org/wiki/Von_Neumann_architecture#Von_Ne...


Memory paging is the major bottleneck if you're on a Macbook Pro running Lion with no SSD.


I don't know much about Macs, but does the OS use a lot of memory or something? Or does it have to do with the hardware?


I'm not sure exactly why this happens, but it does use a lot more memory than you'd expect. Right now, I have 13 Chrome tabs open, Mail.app, a Terminal session, Colloquy, and TextWrangler running but with no documents, but it has 1.14 GB wired (as in, can't swap) and 1.66 GB active. That's a total of 2.80 GB memory in use.

But also, it takes a while to swap (upon which it beachballs all over the place), and it's not very intelligent about when to swap.

It's a 2.00 GHz quad-core machine, so I have plenty of CPU power. It's just that when I get working on more than one or two things at once, switching between them swaps everything to heck.


Informed users know that this 'memory usage' is caching, not leaking and that you can limit it if you really want.

BTW, History / Recently Closed Tabs is one of my favorite FF (only) features.


"Recently Closed Windows" is even better, for those times when you accidentally manage to close your main browser window with 200 open tabs, expecting Firefox to restore them the next time you start the browser, without realizing that you have a dinky little popup window left over somewhere.

But also note that Opera's had a Recently Closed Tabs dialog for as long as I can remember.


> BTW, History / Recently Closed Tabs is one of my favorite FF (only) features.

Chrome also has the "Recently Closed" list.


The list under 'History'? That's not the same, just history.


No. Open a new tab and on the bottom right look at 'Recently Closed.'

It's been in Chrome for awhile.


Oh, I see. Thank you!


Since months (I would say Firefox 7), Firefox is better than Chrome when used with a lot of tabs.


Chrome uses more memory, but for good reason. I think they load more stuff in RAM so the browser works faster, and there's also the sandbox security feature, which makes it so tabs don't share memory, so that must add quite a bit, too. That being said, I wouldn't mind if the Chrome team worked on optimizing RAM usage as well, if they aren't doing it already.


What is the basis of your belief that their increased memory usage is because they "load more stuff in RAM so the browser works faster"? In my experience working on MemShrink, almost all of the things we have fixed are the browser using more memory for no particularly good reason, and I would be surprised if this wasn't also the case in Chrome. You are right that sandboxing does incur some overhead, but I'm not sure how much. But I agree with your overall point, that memory usage is by itself is not as important as overall system performance.


Is 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.


They 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).


Actually it's looking like most of the breakage can be avoided by a simple change on our side.


So 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-...


This 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.


I would love to go back to Firefox as my full-time browser, but I have handful of showstoppers that I haven't found a good way around:

- Inability to run a private browsing window at the same time as my regular browsing. - No desktop notifications. (There appears to be an outdated and/or unmaintained add-on for this?) - No working equivalent of a few app-specific extensions (Google Voice button, Google+ +1 button, Google Reader inline previews)


If you create a second profile, you can start a private browsing session in it without it interfering with the main profile (not as good as Chrome's approach but to me it's just another launcher in the panel).

No idea about the other ones though.


How bad of a tab abuser are you? I can easily reach over 450 tabs. It helps that since Firefox 4, there is an option that doesn't load all tabs when you start Firefox up, but instead only loads the tabs as you switch to them. Tabs that haven't been loaded don't seem to have much footprint at all, so I tend to build up rather a lot of them.


Unfortunately, that works only if you're frequently closing and reopening Firefox.

I tend to leave it running all the time.

For me, I went with an Add-On named "TooManyTabs": https://addons.mozilla.org/en-US/firefox/addon/toomanytabs-s...

"To SPEED UP your Firefox, when a tab is added to TMT, it is unloaded from browser and its tab state & history are stored in TMT. When you click on a tab, the tab is opened again from disk cache, with tab state & history restored if available; (Please note that the memory freed varies and is subjected to different websites.)"

When I come back to the browser, if I haven't used it in a while, I send all the currently open tabs to a new row which unloads them from browser memory. Then, when I get a chance, I go back to the various rows and clean out the tabs I don't want to keep and the condense them down to the "real gold".

Once I have what I want to keep, I restore the tabs and then use another Add-On named "CopyAllUrls": http://www.plasser.net/copyallurls/

This one lets you generate, to the clipboard, any number of markup formats (including HTML) containing the details of all the tabs you have open (with configurable options for details).

I tend to paste this comment into Gmail with a special tag (myaddress+selfnote@gmail.com) which triggers a "mark as read" filter. I do this because all I need is web access, regardless of the browser, and I can get access to all my bookmarked content with the power of Google Search. In addition, on my desktop and mobile phone devices, the mail is automatically sync'd to it for me to carry around for instant access.


I do leave Firefox open for days at a time (usually start it up when I boot into Linux, and close it when I reboot for a kernel update). The Firefox team seems to have fixed most of the leaking that was occuring back in the 3.6 days. As things are right now, there is no way Firefox can use enough RAM to have any impact on my system. Using something like TMT would probably end up slowing down Firefox for me, since stuff would have to be read into RAM from a magnetic HDD instead of being in RAM already. I don't think that Linux has used more than 1MB of the swap partition since I installed it on this laptop. I guess TMT would be useful for those people who have less than 768MB of RAM (what my old laptop had), which doesn't tend to be many people nowadays.

The second add-on you have linked is interesting due to the many possibilities it opens up. I am certain that some people who read Hacker News will find it useful for their purposes.


Yes I am as bad as you are with tabs, possibly worse cause I have hit 800s once in a while.

Just like you said, for me tabs are my "volatile" bookmarks and a TODO list. The upside is that it automatically records the history of the browsing session a call/cc if you will. It is also in my face, reminding me about it. It has a tiny cost associated with keeping it open forcing me to not procrastinate on it for ever. Many a open tab graduate into being genuine bookmarks.

I have tried FF4 and without add-ons it does not do everything that I do with 3.6 with add-ons. The critical part is unloading the content of the tabs when it has not been viewed in a while. The other feature I like is the ability to search through the content of the tabs.

With the add-on set that I have, I leave my FF open for months on a 512Mb box with no issues. So I assume all the leaks have been iron out of 3.6 by now or the memory fox add-on does a good job of garbage collection.


How do you guys manage your tabs? I have ~100 and I sometimes feel like I'm drowning. That option you mentioned really helps.


I basically use tabs as temporary bookmarks. I don't try to look through them very often. If I want to go to website, I just open a new tab and type the name/URL into the address bar rather to look through the tabs I have open to see if it's already open somewhere. When Firefox opens a switch to an open tab, I do take the option.

I browse through the tabs I have open at leisure, finishing the business I have with them as convenient. I can easily end up closing 200 tabs during a period like that, since afterwards they're not useful to me anymore. When I am done with a website (say, opened all the interesting articles and comment pages from the hacker news frontpage) I do close the tab, instead of leaving it open and looking for it later.


Have you used the tab grouping feature?


I use Tree Style Tabs. I think it's better than tab grouping.


Is this an about:config setting? Can you please share?


It used to be only an about:config setting, but now you'll find it in Preferences, General, Don't load tabs until selected.


Why not spend a few dollars and double or quadruple your memory?


I 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.


Get a real computer or quit your bitching.


In 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.


On 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.


Every 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.


IIRC both Google's and Mozilla's browser metrics showed that a vast majority of users (>90%) never open more than 5 tabs simultaneously. Chrome is optimized for this use case, both from a memory as well as interface perspective. So for most users it works very well, better than the competition I daresay. Unfortunately it tends to completely break down once you go too far out of its comfort zone (i.e. using many tabs). Unless you have immense amounts of memory (> 4 GB) the gigantic memory use will not only affect Chrome itself but also all other programs as the OS starts swapping their pages onto the hard disk (which have to be swapped back upon access which is slow). Additionally, the interface was clearly never intended to be used with too many tabs as it lacks any kind of tab overflow concept. And the interface starts to lack badly which for me is an indication that there are bottlenecks in the single browser process which handles the UI.

Firefox behaves far more gracefully in less regular use cases. With tab groups, switch-to-tab, don't load until selected and tab overflow I can easily have dozens of open tabs without affecting the performance of Firefox and the system too much while remaining quite convenient to use. Mozilla just has to improve the regular use case to be in a better competitive position. Once they've achieved this Firefox will be usable by a far wider range of possible users than Chrome.

Oh, and one of the reasons for Chrome's success (besides the sneaky bundling stuff) is probably the extremely convenient silent updater. I've installed Chrome on many computers which belong to people with little technical knowledge so I wouldn't have to bother with browser updates (users have no say in this) and outdated Flash versions (since it is bundled). Now, the latter reason wouldn't be necessary if Adobe wouldn't be such a bag of fail but that's another topic.


You're right, but most people will not notice Chrome's sluggishness because Google has worked very hard to ensure Chrome feels fast. That, and (in my experience) the fact that most Chrome users rarely go beyond 15-20 open tabs, make Chrome an overall better experience than Firefox for many people. In UX design, perception of speed counts almost as much as actual speed.


The key for that is that the UI is in a separate process. Firefox for android (Nightly and Aurora) also do that.

Of course Chrome also has a process per tab (and in fact a few more than that), but the main thing is really a separate UI process (or lockless thread for that matter).

Interestingly this is also what made BeOS so snappy. All BeOS apps require an UI thread that is separated from the rest.

All that to say, while Firefox probably won't get a process per tab, I'd like if they ported the Android UI process to the Desktop.


Actually in Firefox for Android the UI is just on a different thread than the web content, not in a different process.


V8 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/


I am quite aware of v8 and how Mozilla is "trying to beat them". I worked on Firefox's JIT.

As it turns out, the optimizations in v8 don't do very much above the baseline JIT except in careful microbenchmarks: https://www.cs.cmu.edu/~ishafer/compilers/files/report.pdf

The difference in speed between the two browsers in real-world code is quite minimal.


I've noticed substantial improvement using Chrome in real-world use cases. The optimizations I've experienced happen in larger apps that hold much more in memory (I don't consider Facebook/Gmail/Wordpress especially object intensive or CPU intensive, do you?).

Speaking historically, you would say that Firefox 3.5 was as fast as Chrome 3 in real-world use cases? Or that Firefox 4 paralleled Chrome 10? Mozilla has been pushing that they're faster, better, ahead-of-the-curve for years and many people have switched because they haven't delivered until very recently.

Maybe only 10% of that is due to the JIT compiler but you can't easily say Chrome hasn't been faster for an extended period of time since it was released. I'm unsure of whether the remaining 90% is due to DOM interaction, rendering, or just perceived crappiness but it exists nonetheless.


"I'm unsure of whether the remaining 90% is due to DOM interaction, rendering, or just perceived crappiness but it exists nonetheless."

A mix of all of that. For the DOM part Mozilla is developing new bindings (called Paris bindings) to close the performance gap compared to the competition [1]. Johnny Stenbeck has written two articles which give an interesting insight into past, present and future DOM bindings in Gecko [2][3]. Azure is Mozilla's new rendering API which even in its infancy showed some promising performance improvements [4][5]. Unfortunately work on Azure hasn't been progressing as fast as I had hoped. AFAIK only the canvas element is currently using Azure for rendering, the rest (ui + content) is still based on legacy APIs. On the JavaScript front there's IonMonkey, a brand new JIT compiler developed from scratch [6]. It's still in ongoing development and lacks many optimizations so right now it's slower than Mozilla's current JIT compilers in many tests [7].

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=580070 [2] http://jstenback.wordpress.com/2012/04/07/history-of-mozilla... [3] http://jstenback.wordpress.com/2012/04/11/new-dom-bindings/ [4] http://blog.mozilla.org/joe/2011/04/26/introducing-the-azure... [5] http://www.basschouten.com/blog1.php/comparing-performance-a... [6] https://wiki.mozilla.org/IonMonkey [7] http://arewefastyet.com/?a=b&view=regress


Also relevant: https://bugzilla.mozilla.org/show_bug.cgi?id=539356

That bug is getting close to being done. It fixes a lot of crappyness with excessive layout reflows and painting.

You can see how sometimes Gecko will reflow a much larger area than needed by setting nglayout.debug.paint_flashing to true or installing the following addon: https://addons.mozilla.org/en-US/firefox/addon/toggle-paint-...

Notable cases of excessive reflows: Hovering over the sidebar links in gmail (updates almost the entire page on each hover) Hovering over "related videos" links on youtube (updates all of the related videos area, area around the video, video description, and comment area) A lot of the javascript powered animations/slideshows you see on web pages. (Again, its not uncommon to see almost the entire page being updated here) A few IE test drive tests like BetaFishIE, Santa's workshop, and the CSS maze solver.

When the above bug is fixed, Gecko should be much better in all of these cases.


> I've noticed substantial improvement using Chrome in real-world use cases.

And I've noticed Chrome hits the disk more often when switching between tabs than Firefox does, which makes my real-world use cases a lot slower.


That's pretty much my experience, with one additional issue that really keeps me coming back to Firefox: Chrome doesn't handle sleep and wake-up well.

Ironically, one of the applications that suffers most from this is Google Apps. I'll have calendar, gmail and half a dozen spreadsheets and documents open, move to another room, re-open the Macbook and Chrome dies on all the tabs. Firefox has no problem with this.


On Linux and Windows, Chrome used to be significantly faster. Especially on Linux, where Firefox was honestly miserable to use. Now it's just a little bit faster to start up, and is just a little bit snappier.

The OS X ports of both browsers are a little bit infamous for being iffy, aren't they?


Almost every Firefox thread has a comment like this. I'm no Firefox expert, but I use it a lot. The most common question asked in response is:

   What extensions are you running? Can you disable some of them.
I run ABP, Ghostery, HTTPS Everywhere, Firebug. No probs wrt memory.

Wrt CPU: are you sure you didn't have flash videos playing in a few of the tabs? :)

Btw, in my limited experience the meme that Chrome uses less memory is false. It just splits it across many processes (and IIRC this was shown recently using graphs and everything) making it harder to infer in something like Windows Task Manager.

Except wrt startup time, Firefox feels as fast (or faster) than Chrome.

Firefox needs to work on two things:

1. Raw startup time

2. speed up loading of awesomebar info after startup: even a simple-minded thing like write out the entire file under a new name every few days will probably defragment the file. it seems like that file gets heavily fragmented leading to long delays to load it. I might be wrong about the root cause.

YMMV.


For #2, try Vacuum Places Improved:

https://addons.mozilla.org/en-US/firefox/addon/vacuum-places...

It gives you a button to defragment your Places database, which might greatly speed up your awesomebar. You can also set it to run automatically at startup after the browser has been restarted X times (by default X is 50, and I'm not sure that I restart Firefox 50 times in a year, so you may want to reduce this).


FYI, firefox does this automatically (although doubtless the exact behavior has changed since 2009).

https://bugzilla.mozilla.org/show_bug.cgi?id=512854


Thanks! I'm trying it right now.


As I mentioned, I only opened a single page. This page had no JavaScript. I only loaded it once. I only have Firebug, 1password and xmarks installed. But it doesn't matter, Firefox is a slow memory hog, it has been since 1.5.


I 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.


Something is obviously wrong there, and as seen in many other posts in this thread, that is not the case for most people these days.


> Every time, Mozilla devs claim all the bad bugs will be > fixed in the next version.

Wait a second. Did we say this anywhere this time? Read tfa; does it claim to have fixed "all the bad bugs", or even all the memory leaks?

The headline to this article says that. Sure. But Mozilla did not.


Hey, I wasn't trying to oversell this with the headline, but it really seemed like this was the memory leak that had been patched. (I especially wasnt trying to undermine the rest of the awesome work that you guys at Memshrink is doing)


I wonder if the problem isn't Mac OS specific. I've never seen anything even remotely similar on any of my linux computers.


All 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.


> 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.


As I said, on my linux boxen I have no problem with RAM. They're fast and responsive. I have machines with up to 32 GB at hand (and dual octocore CPUs) but really, for a dev workstation a dual core with 2 gigs and 2 24" screens is more than enough to me, I never waited for gvim to open or anything.

OTOH my Mac with 2 GB feels slower everyday. Frankly, I simply decided that my next laptop will be a linux PC instead of a Mac, now that there are credible PC alternatives like the Asus Zenbook Prime (a few years ago Mac laptops were so far ahead it wasn't even worth trying).


If 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?


Actually 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 :)


To 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.


I observed similar results, even thus ive more ram on all boxes. Linux works very well. Firefox for Linux works very well.

On MacOSX it always feels like there's not enough ram. Including with Firefox, or maybe especially with Firefox.


Just 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.


Really? 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.


I 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...


Same 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.


I'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...)


In 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.


Windows 7 sidebar.exe on my machine regularly wanders north of 4GB, until I restart it.

(It just shows a clock and my CPU core temperatures.)


Mozilla 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.


I 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.


Remember 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.


"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.


I assumed it was something along these lines, thanks for making it clear.


There 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.


Better late than never, but you leaked more than just my system memory...you leaked your own market share.


Yeah, 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. :-)


Its 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).


Yeah, 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.


According 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."


That's just a bug. It will be fixed (there's even a patch in https://bugzilla.mozilla.org/show_bug.cgi?id=752877)


Pfew... 230 megabytes for a running browser. Not long ago that was all my workstation had!


So every extension built with the SDK version before 1.6.1 is suspect.

That's a whole bunch of extensions.


It 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

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.


That appears to be a bug in the approach we're using, and we think we have a fix for it.


This is great news. Any estimate on when these fixes might be released into a production version?


We're on track to ship this in late August.


Almost 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_plugg...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: