
Firefox, Heal Thyself - pilgrim689
http://blog.mozilla.org/futurereleases/2013/05/14/firefox-heal-thyself/
======
acjohnson55
I'm not sure if this applies, but I really hope they provide better tools to
identify badly behaving webpages. Sometimes when my CPU or memory are being
cranked by Firefox, I really just want to kill the one tab out of 50 that's
causing all the problems.

~~~
DEinspanjer
That isn't currently a target area for FHR. Things pertaining to the
performance of particular webpages and such are extremely difficult to tease
out of the data in a meaningful way. Not to say we will never include
something like that in FHR, just not in the first couple of revisions of it.

Have you tried out the about:memory page? It doesn't do CPU, but it is a good
way to see what particular pages are hogging memory.

~~~
piyush_soni
Is it that Chrome is able to do it just because it's a separate process per
tab? (It shows memory consumption by each page.) I try to go to the
about:memory page every once in a while, but first that doesn't show
information in a very intuitive way, and second, NONE OF the 'GC', 'CC', or
the 'Minimize Memory Usage' buttons seem to reduce Firefox's memory usage.
Sometimes pressing these buttons actually increases the RAM usage (as seen
from the Task Manager on Windows) - which is beyond my understanding. The only
way to reclaim the 2 GB of my system RAM firefox has captured is to restart
it.

~~~
mccr8
The garbage collector and cycle collector are run all the time normally, so
clicking on those buttons shouldn't have too much effect on memory when you
are using the browser normally. They are mostly useful for getting to a
settled memory state right after opening a page rather than having to wait a
few minutes for it to naturally happen, or in the rare cases where a GC should
be triggered but isn't.

As for why running the GC might increase RAM usage, I guess it is possible
that some memory had been paged out, but running the GC causes the browser to
touch all memory, paging it back in. That's just a guess though.

------
com2kid
My single largest issue with Firefox stability is constantly running into the
32bit memory barrier. Either split tabs out into multiple processes, or enable
64bit support already.

My browser crashes on average twice a day due to running out of memory and FF
just giving up. It doesn't even crash gracefully, it just up and quits.

(I frequently have ~100 tabs open, and I am quite thankful that Firefox lets
me search across my tabs! Very useful feature)

~~~
thefreeman
I really can't understand how many people consistently talk about having
hundreds of tabs open. What are you so afraid of closing a website for? If
it's that important, you will remember to go back to it later. Usually, it's
not.

Once I get to 10 or 15 tabs I usually end up closing all but one or two just
to stay focused.

~~~
com2kid
> I really can't understand how many people consistently talk about having
> hundreds of tabs open. What are you so afraid of closing a website for? If
> it's that important, you will remember to go back to it later. Usually, it's
> not.

Well the hacker news homepage for instance.

I typically go down and middle click on any story I find interesting, and the
comments section to go with it.

This can easily end up with 8-14 tabs open.

Now repeat the same thing for my Reddit frontpage (or just /r/programming!)
and I can easily hit another 30 tabs within a couple of minutes.

Every URL someone posts in the comments that seems interesting also gets
opened in a new tab. An active discussion easily results in another 5-10 tabs
(and remember, that is per discussion thread!).

If one of those tabs goes to Wikipedia, then I'll middle click any links in
the Wikipedia article that sound relevant. This can add another 10 tabs
easily.

Within 10 minutes of turning on my computer I am now easily up to 50+ tabs.

~~~
progrock
I understand how easy that is to do. But when do you have the time to read
them? Part of the fun of the web, is getting a little lost in it. But I
totally loose focus. Have you ever tried limiting yourself to one window and
the judicious use of the back button?

~~~
com2kid
> I understand how easy that is to do. But when do you have the time to read
> them?

I am a very fast reader. :)

> Have you ever tried limiting yourself to one window and the judicious use of
> the back button?

Well yes, but then Tabs were invented!

My browsing is like a tree, pages branch off every which way. I used to have
to keep track of that entire tree structure in my head, now the browser does
it for me!

~~~
progrock
> My browsing is like a tree, pages branch off every which way. I used to have
> to keep track of that entire tree structure in my head, now the browser does
> it for me!

And how does it do that? Have you got some pictorial representation of the
paths? Do you use a plugin? When you have opened a link in a new tab, how do
you then find out where that tab originated from, or rather where you spawned
it from? How do you organize them? A tab is just a cheap window isn't it?

~~~
com2kid
> And how does it do that? Have you got some pictorial representation of the
> paths?

IE actually attempts to kinda sorta organize tabs properly. FF is odd because
if you left click a tab and have Open In New Tab set, the tab is opened at the
end of your tab bar. If you middle click, it is opened adjacent to your
current tab.

I forget which browser attempted auto tab groups by color. Never worked out
that well for me.

When I say the browser keeps the tree structure for me, I meant that I no
longer have to remember how many pages back I need to go to click the next
relevant link. If I am 10 pages deep into Wikipedia, remembering which
originating article has another link on it I want to explore is difficult. If
I just open each link I want to read in a new tab (instead of immediately
following it) I can finish the current page I am on.

~~~
progrock
Really I was just suggesting trying the one tab approach as an experiment. You
can't read in parallel, but I do understand the idea of backgrounding links to
visit later - so you don't necessarily break the flow of the page you are
currently on.

Back in the day of dial up, I'd use Opera and disable images - to make page
loads quicker. I would connect the modem, go online, open as many links as
possible in different tabs, and then disconnect. And read at my leisure.

It would force me to think upfront at what I wanted to look at, and in the
main it was a pretty good system.

Pages back then would take a long time to load, especially with images - so
background loading your next link, was a habit that you just got into.

I forget which browser has which behaviour with new tabs. Some place the tab
on the end. Which makes sense in terms of using a stack. Your last link being
opened being on the end. Firefox as it does tab scrolling, makes it hard to
see what you have open. So I think now the default is to open the new tab next
to the current tab. Which highlights another inconsistency in between
application tab behaviour.

I used to have loads of tabs open of stuff, that I'd get around to reading at
some point - but I'd basically never read, or it would become overwhelming -
and I'd just periodically shut all the tabs and start again. Later I thought
I'd bookmark anything that grabbed my attention, and go back to it later.
Recent bookmarks can help there.

I don't see much difference between a bookmark and a tab, a tab though just
feels a little more accessible but it's more expensive. Better bookmarking
tools could make tabs easily redundant.

The 'group your tabs' feature of Firefox, just doesn't work for me, and other
tab plugins haven't worked for me either. Opera has tab stacks, but I can't
say I'm that fond of them either. I'd rather something a little more
automated.

Anyway - way off the original topic...

------
thomasbk
Part of this is somewhat similar to how Windows 8 measures "Start-up impact"
of applications that auto-start, and allows you to disable them with two
clicks. (In task manager)

~~~
sp332
Internet Explorer will even tell you how long each plugin takes to start. You
can see the stats in [Gear icon]-> Manage Add-ons. My slowest plugin is
actually Google Chrome Frame :p

~~~
TheCraiggers
I'd say that, given the scope of what that plugin is doing, a slow startup is
not exactly surprising, and is rather expected.

------
Goronmon
Funnily enough, Firefox died on my system today and I haven't been able to get
it working since.

Just freezes after start up, even in safe mode (well, when it even booted up,
which it stopped doing after a couple tries).

~~~
vanderZwan
On my computer it sometimes doesn't open a window unless I open a second
instance of Firefox, and then both suddenly load. Try that maybe?

~~~
piyush_soni
That second 'instance' (it actually keeps only one instance running) might not
be helping in bringing up your windows. Try clearing your (startup/local)
cache, it might have become really big. I do that whenever my Firefox takes
long times to start - if you check in Process Monitor, at that time it is
dealing with those cache folders.

~~~
vanderZwan
I dunno, I just noticed it "pops" up as soon as I try to start it again. Note
that this is the first start I'm talking about. I'll try that cache cleaning.

------
olympus
It looks like the Mozilla team is doing such great stuff nowadays. I converted
to Chrome a few years back and it seemed like Firefox was stagnant. But I
think the competition has been good for them, they've been doing lots of neat
stuff recently. I'm thinking about switching back, or figuring out a way to
use two different browsers.

------
drill_sarge
I recently switched from Opera to FF (beta channel) because Opera now working
on webkit based browser and the current Presto-browser doesn't get any dev
love beside security updates. One thing I noticed is the really slow start up
time of FF and high memory consumption. Also I have the feeling it gets worse
over time because when I start a new profile (even with the same addons) FF
feels suddenly much more responsive, starts faster and so on. I hope this
stuff can help them improve those issues.

------
ripperdoc
An application health dashboard should be standard practice in large software,
especially software that supports plugin and interpreting code. I am sure I am
not alone to feel that software get sluggish with time, or that certain
updates causes a lot of crashes. A dashboard could monitor this and
transparently show whether the application is working as intended, and if it's
slow, show what's slowing it down. Good initative!

------
hollerith
I wish one of the most important tools for publishing and consuming text on
the internet weren't so prone to problems as to require a dedicated health-
reporting subsystem.

My text editor and my email client don't need dedicated health-reporting
subsystems.

~~~
scott_s
Your text editor and email client aren't also capable of running arbitrary
applications. Modern web browsers have more in common with operating systems
than with text editors and email clients.

~~~
hollerith
>Modern web browsers have more in common with operating systems than with text
editors and email clients.

That is the core of the problem right there. The need for a new health-
reporting system is just a symptom or a consequence.

~~~
scott_s
I rather like this fact. It allows things like GMail, YouTube and the
fantastic work I see on the NY Times.

~~~
hollerith
I wish you could have your GMail, YouTube, etc, and I could have a way to use
the internet to access a wide variety of writings without my having to deal
with a system so complicated or unreliable that users are being invited to
learn a new health-monitoring subsystem for it.

ADDED. An argument can be made that my operating system is already a system so
complicated or unreliable that it requires its own specialized health-
monitoring subsystem (of which Unix commands ps, free and top and OS X's
Activity Monitor are a part). My response is that I resent having to deal with
_two_ such systems instead of only one.

~~~
scott_s
I think the fact that the world doesn't work like that is inherent, not
accidental.

Although there are text-only web browsers. But there's a reason I don't use
them.

~~~
progrock
I don't really get the text-only web browser comment.

An aside... If W3m was as fast as Firefox - I'd most likely use it. Bizarre
really as you wouldn't expect it to be slower.

------
diminoten
> and your browser can start healing itself

I wonder what some specifics are for this statement.

~~~
sp332
One way, which is admittedly heavy-handed, is already available. If you go to
Help->Troubleshooting Information, there's a button to "Reset Firefox".
[https://support.mozilla.org/en-US/kb/reset-firefox-easily-
fi...](https://support.mozilla.org/en-US/kb/reset-firefox-easily-fix-most-
problems) Hopefully future releases will automatically detect problems in
individual subsystems and give you more fine-grained control.

~~~
ubojan
Yup, this is currently the best and quickest way to fix problems with Firefox.
If you set up sync, you can reset browser and reload context (extensions,
settings, history, passwords, ...) in a few minutes.

------
dredmorbius
My observations, using both Firefox (well, Iceweasel 20.0-1~bpo60+1), and
Chrome (Chromium 26.0.1410.43-1). In many ways, I prefer Firefox as a browser
(better plugins, controls, tabs, too much Google influence already).

My Firefox experience is getting to the point it's virtually unusable, with
very, very slow response to any actions (especially new tab / new window
functions). We're talking about many seconds, sometimes a minute or more.

While the overall footprint of Firefox is smaller than Chrome, Chrome's
sandboxing of tabs gives vastly better user-based memory management: I've got
the option of killing off tabs ( _without_ closing them) that are using
excessive memory, restoring net system responsiveness.

Firefox uses a single process space, and slowness in one tab seems to extend
elsewhere (my general observation, not based on analysis).

 _A larger part of the problem is a combination of how browsers facilitate (or
don't) content management and browsing as a task and workflow, and the
increasing emphasis on highly-interactive sites._

The lack of such tools, and _especially_ the paucity of bookmarks as a
management tool, means that my usual workflow management is:

\- Open browser.

\- Open lots of tabs. It's not uncommon for me to have 100s of tabs open
across multiple browser windows.

For Firefox, Tree Style Tabs at least give some semblance of structure as to
how I've traced down some link path. The flat horizontal tabs of Chrome
absolutely suck in this regard. Having a better way to navigate the tabspace
would help greatly.

What I've recently discovered, and what's radically changing my use of the
Web, is Readability (Instapaper and Pocket are similar services). It's
amazing. I've written a bit about this at Google+:
[https://plus.google.com/104092656004159577193/posts/PhQR421e...](https://plus.google.com/104092656004159577193/posts/PhQR421etdT)
[https://plus.google.com/104092656004159577193/posts/fVK7aJuB...](https://plus.google.com/104092656004159577193/posts/fVK7aJuBT5Q)

Readability solves three problems:

 _It renders web pages viewable._ Far, far, far too many websites have designs
which are overtly hostile to actually reading content (even HN, to some
degree). Even those which are readable are far too distracting in the present
ad-driven eyeball economy.

 _It manages my reading list._ Rather than opening content in tabs, I append
it to my reading list. Readability also offers tags (though limited to 500 per
user, a wall I hit 2 days in) to help organize content (Firefox offers these
for bookmarks, Chrome does not).

And the reading list is available across different browsers and devices (I'm
not usually a fan of sharing personal information, least of all my reading
interests, through a service, but in this case the convenience factor wins
out).

Both of these factors could be addressed, somewhat, in a browser. I've been
agitating for a while for a bifurcation of the browser space. Give me:

1\. A browser primarily oriented at _CONTENT_. Simple, minimal page
presentation (along the lined of Readability), focusing principally on core
page content. With wide margins, high contrast, and a readable font face, and
the ability to manage, organize, prioritize, sort, search, and cross-reference
content.

2\. A browser that is a highly-interactive application engine. Essentially
today's Chrome (this fits with Google's long-term interests at replacing
desktop apps).

We've mashed both of these under a single roof, and the fit's getting
increasingly awkward.

Some things that would greatly help Firefox (and Chrome for that matter):

 _You do not need to have every tab loaded, rendered, in active memory and
sucking CPU at the same time._

 _Give priority to the foreground tab._ Close out background tabs (on a least-
used / highest-footprint basis) and restore them when they're navigated to.
The tab-switching hit should be bought back by overall greater browser
performance.

 _Completely redesign bookmarks with thought given to workflow._ The
absolutely _WORST_ UI attribute in any environment I've encountered across
platforms is windows which cannot be resized, and bookmark management windows
are horrible in this respect. I need _MUCH_ more space to work with.

 _Improve responsiveness._ One of the most painful aspects is how I interact
with bookmarks. I _can't_ open my bookmarks list, left-click a folder, and
select "add page here" from a menu. Why not? _DO NOT REPLICATE CHROME'S
PLACEMENT OF "DELETE FOLDER" IMMEDIATELY ABOVE "ADD PAGE_ AND FAIL TO PROVIDE
A DELETION CONFIRMATION DIALOG FFS!!!!!*

 _The existing "add page_ modal dialog is fucking annoying as hell* Half the
time I want to refer back to the browser page itself to add information but
the modal dialog blocks all browser page input.

 _Provide a duplicate entry search and reconcilliation._

 _Emphasize tags._ They're present but poorly presented.

 _Emphasize bookmarks for navigation._

 _Improve annotation capabilities, including cross-referencing._

 _Provide a decentralized sharing mechanism._ I don't care for SAAS generally
on privacy basis, think FreedomBox. A low-overhead means to reference a
resource from which I can post/recover my bookmarks from multiple devices and
browsers would be useful.

 _Include a few lines of context from the page._ Readability's "expanded*
article view is excellent in this regard. Page titles almost always pretty
much exactly suck. Though if you do this, provide both expanded and collapsed
views.

 _ALLOW THE BOOKMARKS LIST TO WORK AS WORKFLOWS._ "Date added", "date
modified", and "last viewed" would be great. An "archive" flag is also useful
(promote unarchived bookmarks up, allow viewing archived bookmarks if
desired).

 _Provide the ability to download the bookmarks source in offline-readable
format._ Readability has the capacity to create ePub and Kindle content.
Though it doesn't have a bulk-export tool (this would fucking completely
absolutely rock my world).

Look at eBook management tools -- Moon+Reader, Calibre, etc. These are
designed with libraries of content in mind. As antipatterns, look at Adobe
Reader and PDF management in general (there is none) and avoid their worse
mistakes, specifically: no management of archives, no bookmarking, no
annotations, fixed-form-factor rendering, craptastic search, no tagging, poor
zoom, very awkward in-document navigation, no cross-referencing capabilities.

~~~
reubenmorais
Re. Firefox:

1\. <https://bugzilla.mozilla.org/show_bug.cgi?id=558882>

2\. This is being worked on. Gecko is a very old and complex codebase, and
doing that without breaking every existing addon is _hard_.

> You do not need to have every tab loaded, rendered, in active memory and
> sucking CPU at the same time. > Give priority to the foreground tab. Close
> out background tabs (on a least-used / highest-footprint basis) and restore
> them when they're navigated to. The tab-switching hit should be bought back
> by overall greater browser performance.

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

> windows which cannot be resized, and bookmark management windows are
> horrible in this respect

Maybe you're talking about Chrome here? I don't know, Firefox's History window
is resizeable.

> Improve responsiveness.

See <https://wiki.mozilla.org/Performance/Snappy> and point 2 above.

The points re. tags, bookmarks and annotations can and should be implemented
as addons.

> Provide a decentralized sharing mechanism F1/Firefox Share was being worked
> on a while ago. I don't know what happened to the project.

> "Date added", "date modified", and "last viewed" would be great.

We have all of that, in the History window.

> Provide the ability to download the bookmarks source in offline-readable
> format.

Seems like a great idea for an addon.

Firefox is not library management software, but it's flexible enough that you
can turn it into one.

~~~
dredmorbius
Appreciate the response and links. Nice to see there's some work on this.

Re: #675539 I'd make unload happen _far_ faster. Within a few minutes, most
likely, subject to some user testing to see what impacts/effects are shown.
Rather than time the unload, I'd suggest limiting use to some number of active
tabs (plus "pinned" tabs). Once that limit is exceeded, start unloading.

Resizable windows: the "Bookmark this link" dialog.

The history information isn't associated with bookmarks, and isn't presented
with them. And while we're talking about history: Vimperators 'u' "un-close
tab" feature is absolutely golden.

The bookmarks download feature is more a "sync", but _not_ to some named web
service. I've always distrusted features such as this, especially where the
mechanism isn't documented. Could just be me not knowing now the feature
works.

 _Firefox is not library management software_ Honestly: I'm starting to think
it should be. Or that if I found something that was it would replace FF for me
(Chrome + Readability largely is given lists, tags, and responsiveness).

~~~
rangibaby
Re: un-closing tabs, right click on your tab bar choose it from there.

~~~
dredmorbius
It took me ... a long time to find that. And I am much more keyboard-driven
than mouse. Just being able to hit 'u' is awesome.

Other control keybindings often interfere with windowmanger bindings I've been
using for well over a decade. The number of competing sets of controls when
you start embedding viewers in apps in webpages in browsers in window managers
is pretty bad.

~~~
Gmo
What about ctrl+shift+T ?

Or I misunderstand what you're talking about.

~~~
dredmorbius
I've got that hotkey mapped to another function in my window manager.

------
devNoise
Will this help them figure out that they need to fix memory leaks?

~~~
shocks
They're already fixing memory leaks. In fact, Firefox now uses less memory
than Chrome.

Let me guess, you're another person who hasn't used Firefox in a few years
hasn't bothered to check out the latest versions at all? :)

~~~
rexreed
For me, alas, with 5 windows open and many, many tabs per window, Firefox
regularly climbs into the 1 Gig+ memory range. The solution: less windows and
tabs, I guess. But I was hoping / expecting the memory profile to change
significantly over the past few builds.

And yes, I am using the latest build, I check about:memory regularly, stripped
out the unneeded add-ons, but maybe I've just got too much stuff open and
those pages have lots of script activity.

Is my usage the issue or is there something that can be improved in my
scenario?

~~~
mpyne
It's hard to analyze memory usage. When you say 1 Gig+, are you referring to
allocated memory, physically paged-in memory, or what?

There can be a very drastic difference between "virtual memory made visible to
a process" and "physical memory actually used by a process", especially in the
context of shared memory systems where you have 5+ processes that are able to
share much of their text and data segments.

I don't have Firefox here so I forget, but does their about:memory page show
the "proportional" memory usage? KDE's KSysGuard has a detailed memory usage
calculator that can display stats like that.

