
Firefox 15 plugs the add-on leaks - AndrewDucker
http://blog.mozilla.org/nnethercote/2012/07/19/firefox-15-plugs-the-add-on-leaks/
======
suprgeek
I am very happy that the Firefox team has finally managed to lick this issue.
When at every occasion I used to raise this issue, the typical Mozilla
Evangelist would answer: "It is because of the add-ons".

My counter to this was that the whole Raison d'être for Firefox is its add-ons
community. You cannot claim that there are great benefits to this approach
while simultaneously ignoring the problems caused by it. Better late than
never. It is critical to have a popular browser alternative to Either IE or
Chrome.

One is closed source and the other is produced by a company whose entire
revenue model is built around showing you the most targeted ads possible in
the maximum number of ways possible.

~~~
bru
>One is closed source

Actually, so is Chrome.

~~~
pilif
The differences between Chrome and Chromium are minimal - aside of Chrome
bunding some mostly unwanted plugins:

[http://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoog...](http://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome)

~~~
azakai
That list appears to be incomplete. For example, there is a windows-specific
closed source software renderer for WebGL that is in Chrome and not Chromium.

------
mindcrime
This is awesome news. The single biggest reason that I initially moved to
Chrome, from Firefox, was the memory consumption situation. But lately,
Firefox has gotten a lot better, and I've basically switched back to FF now as
my primary browser. Hopefully this will make the situation even better.

And that's good for everybody. Competition is a Good Thing and it would be a
shame if Chrome become so dominant as to completely displace Firefox. A
healthy ecosystem with a great Firefox and a great Chrome, along with IE,
Opera, Safari, etc., should benefit everyone in the long run.

~~~
webwanderings
Chrome and Firefox been using memory at equal proportion. I use exactly two
add-ons and comparing FF/Chrome to IE to check on memory consumption, I see IE
doing much better.

------
conradfr
As a webdev who use Firebug (and Adblock) a lot, I'm so glad about this.
FINALLY !

However they are three years too late about that, from a market share
perspective.

~~~
jhatax
Firefox lost market share because Chrome was a leaner, faster, and better
browser. I have started to hear more stories about folks switching back to
Firefox because a lot of their issues with the browser have been fixed. And
based on independent review sites like Tom's Hardware, there is no longer an
appreciable gap in the performance of Firefox and Chrome.

As regards market share, Firefox's market share would be in the low single-
digit percentages if all was lost. This is indeed not the case. With the
profiling and telemetry tools and infrastructure, the Firefox team has built a
foundation that will ensure future releases do not regress memory usage and
overall browser snappiness. Market share is a fickle metric for success
because it is amenable to change. The strides made in the last few months by
the Firefox team have paved the way for adoption growth in the future. Let us
have a constructive conversation around what they need to do next to ensure
more switchers among the HN community.

~~~
drzaiusapelord
>Firefox lost market share because Chrome was a leaner, faster, and better
browser.

Not to mention secure. Sandboxed PDF reader, java whitelisting, sandboxed and
auto-updating flash, etc while FF and IE were arrogantly telling users "Fuck
you, update your own add ons, they're not our problem" even when all the
exploits were from these add ons. Now IE and FF ape some of these features. I
can't wait to hear the next angry Asa Doztler diatribe aimed at enterprise IT
admins and their demands. Asa is a roadmap on how to lose users and quickly
become 3rd best.

Good to hear FF is starting to get competitive again. I hope this trend
continues.

~~~
freehunter
I always wonder why Firefox gives the option to update Java and Flash et al
when it never works. Has anyone ever gotten plugins to update from within
Firefox?

~~~
rhizome
Ha ha, "install missing plugins" is such a zombie feature, I hope some (ex-)
development manager from Mozilla cringes every time they see that on a new
installation.

------
rexreed
The about:memory feature is useful to get a glimpse into what extensions and
tabs are chewing up the most memory, although I haven't had much luck in FF 14
using the GC/CC to correct that. I hope that FF 15 gives the user a bit more
intuitive view and control over the memory consumption on tabs and
addons/extensions.

~~~
crestfallen
Sure, for technical users that might be a nice value add. In fairness though,
a regular person shouldn't have to care--Firefox should just work, stay
responsive, etc.

~~~
rhizome
_In fairness though, a regular person shouldn't have to care--Firefox should
just work, stay responsive, etc._

In fact, that _isn't_ fair. Software has never been like that, and it's
irresponsible to represent to non-technical users that it's possible.

------
zader
For anyone who wants to download the Nightly build for Firefox 15:

Windows version [http://www.mozilla.org/en-
US/products/download.html?product=...](http://www.mozilla.org/en-
US/products/download.html?product=firefox-15.0b1&os=win&lang=en-US)

Mac version [http://www.mozilla.org/en-
US/products/download.html?product=...](http://www.mozilla.org/en-
US/products/download.html?product=firefox-15.0b1&os=osx&lang=en-US)

~~~
nilved
That's the beta version. Release is on 14, beta on 15, aurora on 16 and
nightly on 17.

Firefox nightlies are here: <http://nightly.mozilla.org/>

------
alainbryden
> Leaky add-ons usually cause zombie compartments by holding references to DOM
> structures within a web page even after the page has been closed or
> navigated away from. This prevents Firefox from garbage-collecting the
> page’s compartment.

If an add-on relies on persistent references to closed pages by design (such
as a form data history plugin), is there a way to adapt it to this new feature
to not let Firefox sever it's references under the assumption that it's a
memory leak?

~~~
gliese1337
Copy them. I can think of no good reason that one would ever legitimately want
or need to keep references to a page that is no longer loaded. It's like
returning a pointer to a local variable from a C function; you should expect
it to be invalid once it's scope is gone! Copying is likely to use less total
memory anyway, because it will rarely result in having to allocate new
compartments for the plugins, but it will allow an entire compartment for a
page to be collected, that is otherwise kept around for the sake comparatively
small objects.

This actually seems to me to have a lot of implications for the design of
garbage collectors generally. In theory, correct garbage collectors are never
supposed to collect objects that may still be used, which in practice usually
means "that are reachable". But, we've already got such a thing as "weak
references" to fudge that a little. This seems like kind of the opposite idea-
having a sort of "superstrong" owner reference such that once it goes away,
you know that the object will never be used again (or shouldn't be, anyway,
with future uses constituting bugs), and can be collected despite what other
references might exist.

It also seems like one of those obvious-after-the-fact genius ideas to have
garbage collection running independently per compartment. Do Web Workers,
e.g., get their own separate garbage collection, too? Any kind of shared-
nothing concurrency model ought to be able to do the same thing to improve GC
pauses; are there language implementations (I'm thinking probably Erlang here)
that actually do that?

~~~
nnethercote
Each web worker gets its own compartment, and thus can be garbage collected
individually.

------
mixmastamyk
I'm on Aurora right now (15a2), and after YEARS of bitching am cautiously
optimistic this is really it!

Just a few weeks ago I was closing FF once a twice a day as it approached
almost a GB of RAM. Now it's holding steady at under 230mb! I have few
extensions, but use firebug. I knew it was part of the problem but it's
unfortunately essential for me.

With this fixed perhaps they can now work on tab isolation, another of their
last major issues, (instead of rearranging the interface again).

~~~
lelandbatey
Wow, that's actually very nice in terms of RAM usage. Right now in chrome,
with only 6 tabs open I am using (according to about:memory)800MB of RAM[1]. I
may very well switch back to Firefox if I can get performance like that.

[1]<http://puu.sh/JXL9>

~~~
cpeterso
Is it normal for a gmail tab to use 250+ MB?

~~~
lelandbatey
I don't think it's supposed to, and that's what's making me thing it might be
time to switch to Firefox.

------
mun2mun
I am really happy that Firefox 15 stops most of the leaks caused by firebug.
Competition is good.

------
Sgoettschkes
Wuhu, finally! Let's see if FF does not take 1GB after a few days.

~~~
AndrewDucker
You'll have to wait a couple of days - Firefox 15 is hitting Beta either today
or tomorrow, I believe.

~~~
gsai
[http://www.mozilla.org/en-
US/products/download.html?product=...](http://www.mozilla.org/en-
US/products/download.html?product=firefox-15.0b1&os=win&lang=en-US)

~~~
zader
OSX version:

[http://www.mozilla.org/en-
US/products/download.html?product=...](http://www.mozilla.org/en-
US/products/download.html?product=firefox-15.0b1&os=osx&lang=en-US)

------
pmarsh
One of the issues I've seen people complain about is having to close Firefox
after a few days. I understand you shouldn't HAVE to close a program, but how
are people using their browsers that this becomes such an huge problem?

~~~
dsr_
I don't reboot my desktop for months at a time. Current uptime is 25 days...
25 days ago I moved offices. X stays up. Firefox and Chrome and most of the
other applications I use regularly stay up. Why should this be exceptional?

What's faster than an SSD for loading an application? Switching to the already
open window.

~~~
smithzvk
While this is basically true (and even more so for me, typically 3+ months
before a security update finally nags me into rebooting 1 month after it was
installed) Firefox saves your open tabs, so restarting takes no time and it is
basically like it didn't even happen.

~~~
corin_
You're right (although re-starting firefox isn't quite an instant thing), but
like dsr_, I don't turn my computer off - so why would I ever restart a
program unless I need to? Killing firefox and restoring the session might not
take a long time, but it's always going to take longer than not having to
restart it.

------
twodayslate
I used to be an avid Firefox user. I switched to Chrome because it was faster
and had all the same extensions I used on Firefox. Why should I switch back?
Chrome is still faster no?

~~~
kajecounterhack
I did the ff-chrome-ff switcheroo a number of times. Now I generally use both:
I find that chrome is a snappier startup and has a better flash runtime (since
it does its own rather than relying on adobe). Firefox is more stable / uses
less memory for a larger number of tabs.

I do believe in the mozilla mission for an open web, and it's got fairly
comparable performance overall, so I use it for my main browsing / firebug.
Chrome's for flash-heavy sites and playing with webrtc occasionally.

Inspector on chrome has certainly become quite good -- I've missed firebug
less and less over time as I started using it. Though Firefox's new built-in
developer tools are really sweet and might add enough functionality for me to
miss in the near future. They're adding a command line thing that is super
cool!!

~~~
joshtynjala
> rather than relying on adobe

I may be over-thinking this, but in case you didn't know, Flash Player in
Chrome is still developed mostly by Adobe. Chrome has a different plugin API,
I think, and some extra sandboxing, but the core parts of Flash Player in all
browsers come from the same Adobe-owned codebase, including Chrome's bundled
version.

------
adambenayoun
Finally!

I've been using firebug for quite a long time and I can't even remember at
what version things went off the rail. But ever since Firefox would consume
70% of my CPU and 2GB RAM which is complete nonsense.

Because of these memory leaks, I migrated to Chrome for browsing the web and
constantly having an open tab for Gmail (because that was the only browser
that wouldn't go banana on RAM), but still use FF for doing front-end
development

------
kevinSuttle
I think the fault is not just the add-on devs. If anything, the add-on SDK
should prevent this by default. I'm not sure when Firefox got so memory-hungry
and leaky, but it's the single reason I keep jumping around to Chromium and
Opera. Really, really hoping that this time is for real. It's not the first
time a blog post like this has been posted by Mozilla.

~~~
nnethercote
Hi, I'm the lead of Mozilla's MemShrink project
(<https://wiki.mozilla.org/Performance/MemShrink>) and the author of the
linked post.

Can you tell me what you mean by prior blog posts "like this"? I remember
[http://blog.mozilla.com/nnethercote/2011/08/09/firefox-7-is-...](http://blog.mozilla.com/nnethercote/2011/08/09/firefox-7-is-
lean-and-fast-2/), because I wrote it, but it was accurate -- FF7 did have
some very large improvements.

This "Mozilla claims memory consumption improvements in every release" zombie
lie is something I hear a lot, but it's just not true.

~~~
kevinSuttle
You're right. I was unfairly accrediting those posts to Mozilla. They were in
the blogosphere at large.

------
cpunks
Does this mean Firefox will stop blaming add-ons for its own memory leaks?

------
jfb
That's a cool blog post, and kudos to the Mozilla people, but I have to wonder
about the mindset of the user whose stuck with Firefox even as his setup was
unusable to the point of needing to _install a restart button add-on_. I mean,
I know from being habituated to a given routine, but that seems particularly
self defeating behaviour, especially considering that decent alternatives to
Firefox exist?

~~~
dman
I have a bunch of custom addons that I have written for my workflows - moving
to other browsers is not an option because they arent as easily extensible as
firefox.

~~~
jfb
That makes sense. Speaking as someone who bought MachTen just to host Emacs on
a Macintosh in the bad old days, I am sympathetic. I just am much more of a
consumer of browsers than someone who relies on them to hack with.

~~~
dman
Just looked MachTen up - <http://www.tenon.com/products/mt1.jpg> made me
nostalgically remember afterstep which was the first window manager I used in
linux.

