Re: Firefox fat on Javascript?

Boris Zbarsky <[email protected]> Wed, 11 May 2011 01:27:01 -0400
Newsgroups gmane.comp.mozilla.performance
Message-ID <[email protected]>
On 5/10/11 11:59 PM, [email protected] wrote:
> Guys, what is going on here?

So to sum up:

1)  Your main browsing account takes 143MB of RAM.  That seems ok, 
depending on what you have loaded, what sort of build this is, etc.

2)  Your browser with gmail loaded uses 248MB.  That may be right 
depending on what you've done with gmail in the past.  Note that gmail 
has a known memory leak wherein the memory it takes will increase while 
the page is open.  This leak is due to the gmail scripts holding on to a 
bunch of objects and keeping them reachable so they can't be GCed.  It 
manifests in all browsers.  Google is working on rolling out a fix for this.

3) Your browser with Vimperator.  This could maybe use looking into; the 
last time I ran a debug build in this configuration it asserted like 
crazy due to all the invariants Vimperator was violating, so I wouldn't 
be too surprised if there are issues here.

> However, I think it's safe to say that what is essentially an untouched
> GUI frontend to Gmail should not register as taking up 248 MiB of my
> physical memory!

Why not?

> and neither should a couple of windows with some static
> text and pictures in them just because of a few interface tweaks
> (`Vimperator').

Why not?  Maybe it should, maybe not.  Needs investigation.

> Why would the relatively unused Profiles 1 and 2 be taking up almost
> twice as much memory as the much more heavily used Profile 1?

Good question.  See above?

> Could the long-lived Javascript programs that underly Vimperator and Gmail
> be the culprits?

Yes.

> Are they badly programmed?

Yes.

> Is the Javascript engine badly programmed?

Maybe.

> Surely the Laws of the Universe do not require 2/3 of my physical memory to
> run 3 different profiles of a goddamn web browser. Even Profile 0 seems a
> little rotund; I mean, FFS, that little guy alone uses enough memory to hold
> 16 fullscreen, 32-bit RGBA (that is, including alpha) dumps of my 1920x1200
> resolution screen. WTF is Firefox doing?

about:memory (especially with Nicholas Nethercote's recent changes) 
should be able to tell you some of that.

-Boris