Closed Bug 515352 Opened 15 years ago Closed 10 months ago

Implement Firefox own Task Manager (with live updating of per-tab CPU and memory usage)

Categories

(Core :: IPC, enhancement, P4)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1628531
Tracking Status
e10s - ---

People

(Reporter: RNicoletto, Unassigned)

References

()

Details

(Whiteboard: about:performance and about:memory are current tools [about-performance-v2])

One of the greatest features of Google Chrome is the built-in "Task Manager" (Crash Control) and I would like to see something similar in Mozilla Firefox.

Standard OS Task Manager don't provide much details about browser activity and browser-plugin activity (at least on Microsoft Windows, no information about *nix and MacOSX Task Managers). Even advanced task managers such as Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) are unable to provide details about windows/tabs activities and plugins activities.

Windows XP Task Manager showing Firefox 3.5.x process ==> http://yfrog.com/6tfarmvillefxtmxp
Windows XP Task Manager showing Chrome 3.x processes ==> http://yfrog.com/4pfarmvillechrometmxp
Google Chrome 3.x own Task Manager ==> http://yfrog.com/2ichrometmp

IMHO those information are important both for developers and end-users. 

Just for reference: John Resig explained on his blog why browser task manager is a good thing (http://ejohn.org/blog/google-chrome-process-manager/).

This is an enhancement request that probably can't be satisfied till Electrolysis Project (https://wiki.mozilla.org/Content_Processes) is completed.
I would like to add some bug-dependencies to this but I'm unable to find an Electrolysis meta-tracking bug.
Blocks: 515354
Version: unspecified → Trunk
No longer blocks: 515354
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
(In reply to comment #2)
> 
> *** This bug has been marked as a duplicate of bug 515354 ***

I'm the opener of both those enhancement requests. The two bugs are related for sure, but I don't think they are the same bug:
- browser Task Manager (in Google Chrome) have its own UI and its own preferences (layout columns, elements sorting, ecc...);
- "about:memory" it's an HTML report (dunno if it's static or dynamic) in a separate tab.

So, in my opinion, those enhancement requests are NOT the same bug: please consider REOPEN this one.

I could REOPEN the bug by myself but I am not enough confident to revert a Smedberg decision.
(In reply to comment #1)
> I would like to add some bug-dependencies to this but I'm unable to find an
> Electrolysis meta-tracking bug.

I believe that is bug 516518

(In reply to comment #3)
> So, in my opinion, those enhancement requests are NOT the same bug: please
> consider REOPEN this one.

Absolutely they are different. The about:memory page is simply the "Stats for nerds" link of the Task Manager, and yes it's static. The Task Manager provides real-time Memory, CPU, and Network performance for each tab, plug-in, and the browser itself, as well as an End Process button. I would love to see this kind of feature in Firefox, even if it does need to wait on Electrolysis. If this were to be considered, I even have further enhancements in mind that not even Chrome supplies (e.g. prioritization).
As per cooment #4, REOPENED and added dependency to bug 516518.
Status: RESOLVED → REOPENED
Depends on: electrolysis
Resolution: DUPLICATE → ---
Blocks: e10s
No longer depends on: electrolysis
Priority: -- → P4
Status: REOPENED → NEW
Depends on: 400120
Should Horlander and Faaborg be CC'd? I figured we can open the task manager in a new tab to match the incontent UI styling. Perhaps they'd have some ideas in mind for the UX.
(In reply to comment #7)
> Should Horlander and Faaborg be CC'd?

Sure. UX feedback would be nice. Although this seems to be low priority, but they should be aware of it regardless.
Chance of this making Fx 4 is essentially nil (this is a major new feature that has had no work done on it and we're aiming to be feature complete by Sep 1) so this is low priority ATM.
Yes that's true but it wouldn't hurt to be prepared ahead of time.
Summary: Implement Firefox own Task Manager → Implement Firefox own Task Manager (with live updating of per-tab CPU and memory usage)
What is a real estimation of when this can actually will be available?

This would be awesome. I have 20+ extensions, 10 windows with 10 tabs each, javascript/plugins disabled with noscript extension, yet every time after several hours cpu gets hot and FX uses one core out of the two (50% in task manager) and everything goes slow even repainting and character appearing one second after typing in forms and I have no way of finding out who exactly is at fault for eating my cpu cycles :(

Exiting and restoring session does help indeed, but not for long!
If you are on Nightly, you can use SPS to maybe figure out what is at fault.
  https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-in_Profiler
Yes, I forgot I saw that while googling but it seems too complicated (read "it consumes less time to exit FX and restart than to switch to nightly, break profile, make some configs, run some scripts") :)
(In reply to costinel from comment #11)
> What is a real estimation of when this can actually will be available?
> 
> This would be awesome. I have 20+ extensions, 10 windows with 10 tabs each,
> javascript/plugins disabled with noscript extension, yet every time after
> several hours cpu gets hot and FX uses one core out of the two (50% in task
> manager) and everything goes slow even repainting and character appearing
> one second after typing in forms and I have no way of finding out who
> exactly is at fault for eating my cpu cycles :(
> 
> Exiting and restoring session does help indeed, but not for long!

Probably never. They even abandoned multi process tabs.
Maybe if they move to Blink, Servo or other layout engine sometime in the not-near future.
Mass tracking-e10s flag change. Filter bugmail on "2be0fcce-e36a-4e2c-aa80-0e3d33eb5406".
tracking-e10s: --- → +
(In reply to Andrew McCreight [:mccr8] from comment #12)
> If you are on Nightly, you can use SPS to maybe figure out what is at fault.
>  
> https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-
> in_Profiler

Is there a way to tweak this to find which tab is turning a computer into a jet engine?
(In reply to alexander.kjeldaas from comment #16)
> (In reply to Andrew McCreight [:mccr8] from comment #12)
> >  
> > https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-
> > in_Profiler
>  
https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-in_Profiler
And

(In reply to costinel from comment #13)
> Yes, I forgot I saw that while googling but it seems too complicated (read
> "it consumes less time to exit FX and restart than to switch to nightly,
> break profile, make some configs, run some scripts") :)

Would the built in tool help ? 
That does not require switching to Nightly. Just a few mouse clicks.
https://developer.mozilla.org/en-US/docs/Tools/Profiler
Is per-process-tabs really needed to implement this a feature?
(In reply to Matt Tagg from comment #18)
> Is per-process-tabs really needed to implement this a feature?

Assuming you mean process-per-tab, I sure *hope* not: browser processes aren't exactly cheap!

But it really shouldn't be needed, anyway.  CPU would be the trickiest, but if you can profile you can surely get CPU usage per tab ...
I'd welcome this, it's one of those few things that I really like on Chrome.

And seeing that I have a stable rate of about 200 tabs open in Firefox I really need a way to see which tab is causing those leaks over time (as to why I always have that many tabs is another topic, fact is, I do have them...)

Only a few of those are active (clicked and loaded) at a time, still my Firefox goes from 800MB at start to 2GB depending on how long it's running over time...

Having a nice overview of all tabs, addons and extensions currently being active (or inactive tabs, as they probably also consume a certain chunk of memory) with their respective resource usage in real time and not in a limited way like about:memory shows it would really help track it down.
Another thing useful is to know what window launched or is playing audio/video.  You have to look at every tab to figure out what window is playing the audio/video or what window launched it although the launched window is somewhat easier.
I'm currently experiencing strong lags and many crashes of Firefox.  Memory usage often exceeds 4 GB (out of 8, when it happens I usually kill and restart Firefox), and Firefox CPU usage is most of the time about 100 % of one thread of my i5-4200U.

Filing a bug report would be of no use unless I can narrow down the issue to the relevant tab(s)/webpage(s).  However it's almost impossible to narrow it down without such a monitor (I'll try about:memory, not sure where it'll take me).

I expect other people are in the same situation, which means "potential bugs" are blocked (i.e. not filed) because of the lack of this monitor.  Therefore this is about more than just a "cool feature".
I concur.  The lack of this feature is the reason I've switched to chrome/chromium.  Tabs go insane and start using too much memory or CPU in both browsers.  But with chromium, I can identify and kill the errant tab(s) using top.  With firefox, I have no choice but to restart the whole browser.

I'd rather use firefox but this is a showstopper for me.  I find I need to restart firefox every day or 2.  Chromium lets me get away with longer restart cycles.
> Memory usage often exceeds 4 GB (out of 8, when it happens I usually kill and
> restart Firefox), and Firefox CPU usage is most of the time about 100 % of
> one thread of my i5-4200U.

Visit about:memory to see where the memory is being used. That won't help with the CPU but it might be enough to diagnose the problem.
(In reply to Nicholas Nethercote [:njn] from comment #24)
> Visit about:memory to see where the memory is being used. That won't help
> with the CPU but it might be enough to diagnose the problem.

Yes, actually I mentioned it in my post… ;)

I also figured "Tools > Developer tools > Profiler" could help — it allowed me to identify "b.scorecardresearch.com/rs/vce_st.js" script as a strong CPU glutton.

I believe these workarounds prove it would not be too difficult to provide the tool which is requested here.  But they are not alternatives, as they don't provide per tab information — e.g. in my case opting out from scorecardresearch seemed to help (I never opted in and anyone may be affected, BTW), but I wasn't able (I gave up quickly) to identify the relevant tab(s) (assuming there was at least one).
Five years later and we don't have this yet. I just switched over to FireFox because I'm tired of Chrome shewing up my RAM...  and it doesn't have these basic tools. Disappointing...
Actually, the latest Nightly has per-compartment CPU accounting now in about:performance! It's still very new and the UI is pretty basic right now, but the infrastructure is mostly there. This was added in bug 674779 - I'm not sure if there's a meta bug to track it all.

For memory usage, you can use about:memory, but it doesn't update automatically. I believe there was some 'census' work in progress to get quick data on memory usage, but I'm not sure what the status of that work is.
(In reply to Mike Hammett from comment #26)
> Five years later and we don't have this yet. I just switched over to FireFox
> because I'm tired of Chrome shewing up my RAM...  and it doesn't have these
> basic tools. Disappointing...

Since we don't have multiple processes yet there's no grounds for a task manager either. Multi-process architecture comes with FF4x at the earliest.
(In reply to Mike Hammett from comment #26)
> Five years later and we don't have this yet. I just switched over to FireFox
> because I'm tired of Chrome shewing up my RAM...  and it doesn't have these
> basic tools. Disappointing...

Actually there is an extension to see how much memory each tab is currently using called tab data 
https://addons.mozilla.org/en-us/firefox/addon/tab-data/
(In reply to Off By None from comment #29)
> Actually there is an extension to see how much memory each tab is currently
> using called tab data 
> https://addons.mozilla.org/en-us/firefox/addon/tab-data/

Hallelujah !!!  Many thanks for this link.  (Also, come on, Facebook, 109 Mo per tab ?!?)
(In reply to Skippy le Grand Gourou from comment #30)
> (In reply to Off By None from comment #29)
> > Actually there is an extension to see how much memory each tab is currently
> > using called tab data 
> > https://addons.mozilla.org/en-us/firefox/addon/tab-data/
> 
> Hallelujah !!!  Many thanks for this link.  (Also, come on, Facebook, 109 Mo
> per tab ?!?)

I came to FireFox due to various tabs in Chrome chewing up over one gig each. I upgraded from 16GB to 32GB of RAM and Chrome still chewed it up.

Thus far FireFox seems lighter, but it has completely crashed once and appears to be about to crash again given that tabs won't go to any entered URLs anymore.

That addon does help immensely, but I'm not sure we're out of the woods yet.
(In reply to Off By None from comment #29)
> Actually there is an extension to see how much memory each tab is currently
> using called tab data 
> https://addons.mozilla.org/en-us/firefox/addon/tab-data/

Does that only work when electrolysis is enabled?
Hardware: x86 → All
I have been using Firefox for years and I would like to continue to use it. However I am having so many problems with Firefox that I am considering switching to another browser (maybe Chrome). 

First, Firefox uses too much memory. The amount of private memory the process consumes (Windows7) grows easily up to 2 or 3 GB. I often have to restart the browser to clear the memory. Even closing all the windows (except one) doesn't free up the memory properly.

Firefox uses too much processing power. My Firefox process often uses 50-100% of my dual core CPU. Even if I leave my computer unattended for a few hours, I return and the processor is still sitting at 50%. 

I know that what is really consuming the processor is all of the client-side scripts running on web pages these days. They are getting out of control. 

Without features such as multi-threaded architecture, per tab processes, and a task manager to monitor all the tabs and extensions, Firefox has become unusable for me.

I am starting to use Chrome and if Firefox doesn't implement these features soon I will likely migrate away from Firefox and may never return.

A pity really, I always did like Firefox.
(In reply to Jerry Quinn from comment #23)
> I concur.  The lack of this feature is the reason I've switched to
> chrome/chromium.  Tabs go insane and start using too much memory or CPU in
> both browsers.  But with chromium, I can identify and kill the errant tab(s)
> using top.  With firefox, I have no choice but to restart the whole browser.
> 
> I'd rather use firefox but this is a showstopper for me.  I find I need to
> restart firefox every day or 2.  Chromium lets me get away with longer
> restart cycles.

This is a showstopper for me as well.
(In reply to alexander.kjeldaas from comment #16)
> (In reply to Andrew McCreight [:mccr8] from comment #12)
> > If you are on Nightly, you can use SPS to maybe figure out what is at fault.
> >  
> > https://developer.mozilla.org/en/Performance/Profiling_with_the_Built-
> > in_Profiler
> 
> Is there a way to tweak this to find which tab is turning a computer into a
> jet engine?

Firefox is becoming unusable.
(In reply to Nico Hamm from comment #20)
> And seeing that I have a stable rate of about 200 tabs open in Firefox ...
> 
> Only a few of those are active (clicked and loaded) at a time, still my
> Firefox goes from 800MB at start to 2GB depending on how long it's running
> over time...
> 

Firefox should have some way to limit the amount of memory and processing power used by windows and tabs that are not being used. Only the current window or tab that is in focus should be using memory and CPU. The other ones should just be "paused", or at least given a lower priority. 

It has gotten to the point where I can't have more than one or two Firefox windows open at a time. And I have to close Firefox completely to free the memory that was being used before opening new windows.
(In reply to keepitsimplestupid from comment #21)
> Another thing useful is to know what window launched or is playing
> audio/video.  You have to look at every tab to figure out what window is
> playing the audio/video or what window launched it although the launched
> window is somewhat easier.

This is really annoying. I've started using Flash Block specifically to address this problem.
(In reply to Skippy le Grand Gourou from comment #22)
> I'm currently experiencing strong lags and many crashes of Firefox.  Memory
> usage often exceeds 4 GB (out of 8, when it happens I usually kill and
> restart Firefox), and Firefox CPU usage is most of the time about 100 % of
> one thread of my i5-4200U.
> 
> Filing a bug report would be of no use unless I can narrow down the issue to
> the relevant tab(s)/webpage(s).  However it's almost impossible to narrow it
> down without such a monitor (I'll try about:memory, not sure where it'll
> take me).
> 
> I expect other people are in the same situation, which means "potential
> bugs" are blocked (i.e. not filed) because of the lack of this monitor. 
> Therefore this is about more than just a "cool feature".

I concur.
(In reply to Jerry Quinn from comment #23)
> I concur.  The lack of this feature is the reason I've switched to
> chrome/chromium.  Tabs go insane and start using too much memory or CPU in
> both browsers.  But with chromium, I can identify and kill the errant tab(s)
> using top.  With firefox, I have no choice but to restart the whole browser.
> 
> I'd rather use firefox but this is a showstopper for me.  I find I need to
> restart firefox every day or 2.  Chromium lets me get away with longer
> restart cycles.

Exactly.
We understand your point. It's really not necessary to reply to every comment in the bug.
Flags: needinfo?(RNicoletto)
No news on this? I am having FF with e10s on UI crawling, which should be an oxymoron, and I can not find out which tab concretely makes the process 100% busy.
I've always used chrome. I just switched to firefox hoping to get a better performance.
After installing a couple of plugins the mem usage went from 200M to 700M, and dont even know why.
Googled for a firefox task manager, and ended up here, writing this comment just to say:
How is this not a feature????
There is some progress: just recently final release versions of FF started to have "about:performance" page, where you can see if certain extension or tab uses too much CPU at the moment (updated once in ten seconds or so).

However, it is limited in usefulness since this information is not connected to memory consumption, you will have to look it up separately via "about:memory" page. 

Besides, there is still no standard option to (automatically, by some rule) unload the abusive tabs, only to reload or close them. What would be the best option of all would be ability to (automatically, by some rule) "suspend" background tabs without unloading them -- this would make wonders for FF's speed, but somehow this feature is still not implemented, unfortunately.
(In reply to User Dderss from comment #44)
> but somehow this feature is still not implemented, unfortunately.

The session restore folks opposed it, at least as something that happens by default, because
1) Session restore doesn't store *everything* about a page - unloading and restoring might lose dynamic content for instance.
2) Various web pages have the ability to notify you if something requires your attention - like receiving a new e-mail on GMail. Silently unloading them would lose that capability.

It is a feature that people are considering though, in the context of e10s as well.
Thanks! Is a start.
I don't wanna use chrome anymore. I've been using it since it first came out, but it's memory consumption is just off the charts.
When things got hairy, I like pulling up the task manager and killing a couple of plugins that may be draining my machine.
Whiteboard: about:performance and about:memory are current tools
Now when the Firefox is starting support e10s and porting extension to web-extension then it is necessary to make a plan and good GUI window for task manager. about:memory,about:performance is not going to best way to show process in New Firefox 57

The Task Manager seems to have been added in Firefox 64. To open the Firefox Task Manager, type "about:performance" into the address bar or click ☰ → More → Task Manager.

well, that task manager is better than nothing, but is very limited, with the browser using 100% cpu, open this task manager i only get a few "low" and one "medium" energy impact apps (whatever it mean!) and i'm suspecting it's not showing all the tabs i have open. Actually closing most the tabs that had any activity and keeping just a few with low (and not even always), still have 80% cpu

+1. Just yesterday had 100% CPU usage from FF67 b16 and wanted to see what is causing this. Actually I found zero useful information in the about:performance...

Usually, background scripts pile up on each other if many tabs are open, thus accumulating the CPU load until it reaches 100%.

But sometimes there are one or few especially bad scripts, but this "Task Manager" thing is unable and will never be able to be useful in this mode.

To actually see which scripts comprise the load, it has to become a JS monitor, which can not be on by default as it obviously slows down everything.

So "about:performance" page has to have a switch to turn on the monitor on and off and automatically find the problematic scripts. I doubt that Mozilla will do it though as it becomes too technical so they would rather refer advanced users to use a real debugging/tracing monitor that developers use anyway.

Maybe it has already been mentioned, but for GNU/Linux users a simple "top" is often able to identify "Web Content" processes which seem to correspond to greedy Firefox tabs. Killing them is often enough to get back to a reasonable situation without having to kill Firefox. It goes without saying that this make the "bad" tabs crash.

Whiteboard: about:performance and about:memory are current tools → about:performance and about:memory are current tools [about-performance-v2]

I'm guessing that most of the people tracking this should check out about:performance in Firefox stable and about:processes in Firefox Nightly

Severity: normal → S3
Status: NEW → RESOLVED
Closed: 15 years ago10 months ago
Duplicate of bug: about:processes
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.