
Mozilla: Are We Slim Yet? - cpeterso
https://areweslimyet.com/
======
enneff
A nice manifestation of the idea "What we can measure we can fix."

See also: <http://arewefastyet.com/>

~~~
exDM69
Our engineering team's motto is "if you measure it, it will improve".

~~~
RyanMcGreal
The funny thing is that it's almost true _by default_. The mere fact of
measuring something is often enough to drive improvements.

A couple of years ago, I installed the RunKeeper app on my phone and started
tracking how long it took me to walk places. Over the course of a few months,
my walking speed increased from a pokey 5 km/h (3mph) to 8 km/h (5 mph). I
didn't install the app with the goal of walking faster; it just happened as a
side-effect of regular feedback on how fast I was walking.

~~~
pbhjpbhj
See also <http://en.wikipedia.org/wiki/Hawthorne_effect>

~~~
RyanMcGreal
My understanding of the Hawthorne effect is that it is a _temporary_ increase
in performance due to the subject's awareness of being studied. I stopped
using RunKeeper over a year ago but my default walking speed has remained much
higher than it was when I started measuring it.

------
ticks
I used to have loads of problems with Firefox, it was so slow... took several
minutes to close, it would freeze regularly etc. I got so sick of having to
clear the cache every few weeks.

Then one day I noticed their hidden profile manager, created a new profile and
used it instead. A few months on and everything is still working like it
should. No need to clear caches, it quits within seconds, no crashes and so
on.

It's worth a try if you get something similar. Obviously something was screwed
up with my profiles, it took a really long time to delete the old profile.

~~~
cpeterso
Vacuuming your Firefox profile's SQLite databases can significantly improve
startup time:

[http://mozillalinks.org/2009/07/vacuum-your-firefox-
database...](http://mozillalinks.org/2009/07/vacuum-your-firefox-databases-
for-better-performance/)

There was a bug request to auto-vacuum profiles after an upgrade, but the bug
was closed as WONTFIX:

<https://bugzilla.mozilla.org/show_bug.cgi?id=395020>

~~~
starwed
If you read that bug, it was WONTFIX'd because they chose a different way of
scheduling vacuums.

------
taylorbuley
Yet another a paragon of communications transparency from Mozilla. Here's what
we're trying to do (<https://areweslimyet.com/faq.htm>). Here's the data
(<https://areweslimyet.com/>). Here's how you can get involved
(<https://github.com/Nephyrin/MozAreWeSlimYet>).

------
DHowett
I'll admit that I was expecting a site more like
<http://hasthelhcdestroyedtheearth.com>.

It's really nice to see that Mozilla is still taking this stuff into
consideration. After all, memory has been a point of contention in the
community since Firefox 3 or so.

I know the FF detractors are going to come out of the woodwork at any moment,
but I feel that reports of Mozilla's death have been greatly exaggerated.

~~~
peterhajas
Read this last night, agreed. Only now noticed the username :)

Do you use it as your fulltime browser? Why is it better than Webkit-powered
alternatives?

------
Mavrik
I'm just hoping slimming down memory usage won't go at the expense of speed...
my systems have 16GB of RAM - I want Firefox to use as much memory as possible
to speed up my experience. So if slimming down FF will make my disk trash
more, that's the wrong direction to take.

~~~
fl3tch
In an age when most computers come with 4+ GB of RAM, I think people focus too
much on memory. Of course there are older computers, but their OS should be
using comparably less RAM. WinXP takes up 100 MB at login, so if you only have
1 GB on an older computer, you should still have no problem running modern
Firefox. And if you only have 512 MB, it's probably time to upgrade since the
web experience that a modern browser can offer you will be crippled by your
old hardware.

A few months ago I had a conversation with somebody who complained that
Firefox used too much memory (about 600 MB). I asked how much he had. He said
3 GB. That seemed more than enough to me, after all Gnome consumes 200-500 MB
at login, depending on whether you're using 32 or 64 bit and which shell
you're running (Gnome 2, Gnome Shell, Unity, etc). Turns out, Win7 was eating
_2 GB_ at login, leaving him with only a gigabyte for other programs.

In my view, the operating system is just a platform to launch other stuff. It
shouldn't use more than 25% of your memory. If it does, you should either get
more RAM or slim down your OS. If his computer obeyed my rubric, he'd have
plenty of room for Firefox. His anger was obviously directed at the wrong
problem, but for some reason the OS (and all the crapware which loads at boot
and runs in the background, even when it's not needed, consuming precious
resources) gets a pass.

~~~
joblessjunkie
But _why_ do our computers have to come with 4GB+ of RAM, when 1GB might
suffice? It's an circular argument to claim that it's OK to use lots of RAM
simply because the computer comes with lots of RAM.

After a manufacturer begrudgingly provides the RAM that developers refuse to
conserve, we shouldn't then use the presence of this additional RAM to use
even more.

Your friend's anger at application waste is justified. Witness new devices
like the iPad that survive with much less RAM than a desktop -- just 512MB,
which happens to be enough to support an excellent browser.

~~~
mburns
We use that memory because we do more things faster. Of course we _could_ page
to disk whenever we want to use more than 1GB of memory, or render from CPU
instead of keeping uncompressed versions in memory to lower footprint... Or we
could have faster computers. Consumers prefer the faster computer option.

~~~
joblessjunkie
Sure, using more RAM to make things faster is a fine thing. But I think you
give developers too much credit: many apps use lots of RAM for no other reason
than lack of care.

Which of course can also be to the benefit of consumers: better a RAM-hogging
release today than a memory-efficient release next month (if ever).

------
ck2
Coming soon: <http://arewesnappyyet.com>

[http://blog.mozilla.com/tglek/2011/12/01/introducing-
project...](http://blog.mozilla.com/tglek/2011/12/01/introducing-project-
snappy/)

Part of Firefox 13 and beyond...

------
Kesty
Not yet, but getting there.

Also the bazillion extension that exist for Firefox are not really helping.

A "task manager" to be able to keep on eye on all extensions memory
consumption (and be able to kill the extension from the browser) should really
be helpful.

~~~
pbiggar
Try about:memory, it's pretty good.

~~~
Kesty
Yeah, it's not really great either. The about:memory page in Firefox is a
little bit too technical compared with the about:memory in chrome that is, at
least, simple and easy to understand what is going on.

In Firefox I still see a lot of memory commited to tabs that I've closed long
ago, and can't really get a breakdown of my extensions memory usage.

Also what I was wishing is something more like a os task manager. Where I
could kill or restart extensions that are using too much memory like I can do
to normal applications.

Simply stating that this extensions is using too much memory so don't use it
(a la IE) won't help. If that extension is the main reason I'm using your
browser I'm not going to turn it off.

I'm not saying it would be easy or even doable right now, it's just what I
wish to see in a future web browser to keep the memory down and prevent me
from killing it and restarting it twice a day while working.

~~~
nnethercote
about:memory is intended to be a tool for developers and highly technical
users. But we're getting close to the point where per-tab memory reporting
will be feasible, see <https://bugzilla.mozilla.org/show_bug.cgi?id=687724>,
which is currently blocked on some other infrastructure changes.

Once that's in place, we can slap a friendlier UI on top, something more like
the about:nosy add-on ([http://www.visophyte.org/blog/2012/02/04/aboutnosy-is-
aboutm...](http://www.visophyte.org/blog/2012/02/04/aboutnosy-is-aboutmemory-
with-charts-helps-you-lay-blame-more-easily/)).

If you're seeing memory for tabs you closed a long time ago, we'd love to hear
about it.
[https://developer.mozilla.org/en/Zombie_Compartments#Reactiv...](https://developer.mozilla.org/en/Zombie_Compartments#Reactive_checking)
has documentation on how to check for these cases.

As for measuring memory consumption of extensions, you're about the 1000th
person to suggest it :/ New-style ("JetPack") extensions have some tracking,
but old-style ("XUL overlay") extensions are really hard to measure,
unfortunately.

If a critical extension is using too much memory, one option that might be
suitable is to create a separate profile. E.g. Firebug leaks a lot
(<https://bugzilla.mozilla.org/show_bug.cgi?id=669730>) and some people only
need to run it occasionally. Depends on how often you use the extension, of
course.

------
div
This is exactly the type of thing the Firefox team needs to do.

Measuring memory usage causes engineers to focus on it.

Making the data available piques the curiosity of geeks who historically drive
change (in a "you should use this browser" way).

Having a few charts comparing with other browsers (chrome in particular) would
be a good idea too, especially once they start beating chrome (if ever
obviously).

------
fauigerzigerk
I'm glad they are working on that. Right now I'm not using Firefox because
after a day or so typing into a text box starts to stall. I'm not sure it has
to do with memory usage, but it has been that way for years on my Mac. Not on
Windows or Linux interestingly.

~~~
freehunter
I do wish there was a good browser I could keep open for weeks and not have to
worry about how much memory its using at the end of it. Even on Chrome, using
it without closing it for a few days runs me into a lot of memory used. I know
a bit of this is used for keeping the history so you can go back or undo
closed tabs, but I wish there was a way to make it forget that without closing
it (maybe there is?)

~~~
presto8
Trying blocking Flash by default. I leave my Chrome windows open for long
periods of time. After a while, the memory consumption would get out of
control. I finally realized that it was Flash that was causing the problem.
There are many Flash blockers out there (you can right-click to enable it on-
demand as you need it or use a whitelist) and newer builds of Chrome have
built-in support for blocking.

------
Tichy
Is it the same old fallacy that consumed memory is somehow bad? What if they
use it for efficient caching?

~~~
nnethercote
Trade-offs exist! How astonishing.

From <https://wiki.mozilla.org/Performance/MemShrink>:

"MemShrink is a project that aims to reduce Firefox's memory consumption.
There are three potential benefits.

1\. Speed. Firefox will be faster due to less cache pressure, less paging, and
fewer/smaller GC and CC pauses. Changes that reduce memory consumption but
make Firefox slower are not desirable.

2\. Stability. Firefox will suffer fewer aborts/crashes due to virtual or
physical memory exhaustion. The former is mostly a problem on 32-bit Windows
builds with a 2GB or 4GB virtual memory limit, the latter is mostly a problem
on mobile devices that lack swap space.

3\. Reputation. Fewer people will complain that Firefox is a memory hog and
that Mozilla ignores memory usage."

~~~
Tichy
I am not a specialist on that stuff, but I note the "will". If they have
launched and noticed actual improvements, I'll be interested.

~~~
ssheth
nnethercote on the other hand is the "specialist" as he is in charge of the
MemShrink project itself... I would trust him on this stuff.

~~~
Tichy
OK, but the developers of Mozilla are specialists, too. Why not trust them? Or
is nnethercote part of the Mozilla dev team? MemShrink will hopefully just be
merged into the core?

~~~
nnethercote
I'm a Mozilla employee and started MemShrink. I also write about it regularly:
<http://blog.mozilla.com/nnethercote/category/memshrink/>.

MemShrink has been running since June 2011 and there have been many
improvements in Firefox's memory consumption since then; these have shown up
in Firefox 7, 8, 9, 10 and 11.

------
wanderr
I'm glad they are doing this because they need to do something about memory
usage, but there are some problems with this approach. -websites change over
time. If a site gets redesigned, it'll throw off test results unless they're
rerunning the tests on old builds too -this still doesn't capture how users
actually use browsers so could miss some serious leaks. What about clicking
around on the same site, opening links from the same site in multiple tabs,
leaving a tab open for a week, etc?

Additionally, they keep saying that extensions are a huge source of leaks. I
feel their pain because they don't have that much control over them, but they
need to come up with some sort of a solution to deal with it, because let's
face it, who's going to run FFx without any extensions?

~~~
buro9
Extensions should be given an aggressive memory limitation to work with, and a
profiler should be made so that extension developers can see what they're
using and where it's spent.

Constraints are good things.

~~~
ferongr
For various reasons this cannot be done for most traditional extensions that
introduce advanced functionality (e.g. AdBlock Plus), since they can override
the browser's functionality without limitation. Add-on SDK extensions are
another matter but those are comparatively very limited in what they can do.

~~~
obtu
This can be fixed with a split model. Chromium sometimes introduces fairly ad-
hoc APIs (there was one to hook into HTTP requests, first declaratively which
was discontinued, then with JS-side filtering which seems to be used by the
ABP port); Jetpack add-ons can also use custom modules that hook into the full
Firefox API. That way, the part that needs care and auditing for
memory/lifetime issues can remain small.

[https://addons.mozilla.org/en-
US/developers/docs/sdk/latest/...](https://addons.mozilla.org/en-
US/developers/docs/sdk/latest/dev-guide/tutorials/reusable-modules.html)

------
ilaksh
They are measuring and trying to fix the wrong things. I don't care if you
think you are 'lean'.

The problem is that you have some stubborn devs or decisions that were made a
long time ago that need to be reversed but for whatever reason are not being
reversed or are hard to change.

What I care about is perceived start up time and perceived overall
performance.

For perceived start up time to improve they have to stop doing some things
that they normally wait to finish doing before showing the screen. Like
waiting for all of the tabs to load, checking for updates to add-ons, etc.

For overall performance to improve I think they need an extra performance mode
that will restrict what Addons can do.

~~~
jacobsenscott
There's a fix for one of those. Preferences -> General -> Don't load tabs
until selected

------
Erunno
Maybe Mozilla should consider creating arewetolerantyet.com in the light of
Brendan Eich's donations to questionable political campaigns.

SCNR ;)

------
lambada
Nowhere on the page does it say what TP5 stands for. Google has also been
unhelpful? Can someone explain?

~~~
guelo
It's in the FAQ <https://areweslimyet.com/faq.htm#how-is-this-data-generated>

~~~
lambada
Actually, even that just used the Acronym without explanation. I missed the
link in the 'answer though'. So 'after TP5' means after loading a manually
curated list based on the top 500 web pages? Huh, in that case I'm impressed
with how Firefox has improved.

~~~
jlebar
Yeah, I don't know what the "P" in "TP" stands for. Maybe "pageset". "T" is
for "Talos". It's version 5. Or at least, the previous one was TP4 -- I don't
know if there was a TP3. :)

> So 'after TP5' means after loading a manually curated list based on the top
> 500 web pages?

Yes. TP5 is a list of 100 pages (based on Alexa 500, I believe, but I'm not
sure), and we load the pages 5 times in 30 tabs.

------
toomanysecrets
Not really.

------
Teapot
"Do i look fat?" It's a trap! If we say 'No' then the bloat continues. And if
we say 'Yes you're fat' she runs away crying. And the bloat still continues.

Honestly, Yes. You're still fat. But some progress has been made. Keep going.
Stop when you hear the first complaint about too skinny.

~~~
jlebar
You mean, like "my systems have 16GB of RAM - I want Firefox to use as much
memory as possible to speed up my experience."?

~~~
DanNeely
Given the choice between being forced to restart my browser because it's
memory use is approaching the 4GB limit of a standard 32bit process rendering
it unusable, despite my having several GB free; and it being able to remain
stable by expanding past 4GB I'll take the extra memory usage.

Improving memory usage so that my browser never approaches the 4gb point in
the first place would be ideal; but based on my personal history I strongly
expect that any such gains will continue be eaten by increasingly heavy use on
my part and those of sites I visit.

