Alt-tab to Firefox sends Firefox to 100% CPU; unity-panel-service to 80% CPU and hud-service to 20-80% CPU

Bug #968533 reported by Paul Sladen
414
This bug affects 109 people
Affects Status Importance Assigned to Milestone
Unity
Fix Released
High
Unassigned
indicator-appmenu (Ubuntu)
Fix Released
Undecided
Unassigned
unity (Ubuntu)
Fix Released
High
Unassigned

Bug Description

I've been seeing UI hangs after switching tabs in Firefox, and switching from other applications to Firefox.

It can take 3-8 seconds to change *tab*. During this time the CPU is maxed out; typical output from 'top' during this period shows 'hud-service' and 'unity-panel-service' combined using about the same CPU as Firefox itself:

 100 10.4 26:07.73 firefox
  53 0.6 6:14.86 hud-service
  38 1.5 6:42.14 unity-panel-service

I suspect that the change is causing a (an inefficient) re-index related to updated menu structures. (Eg. something like the history menu, although I can't see what it is as don't currently have a menu bar).

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Thank you for submitting this bug report. I have not been able to reproduce this bug though. I keep alt-tabbing everyday between firefox and other apps and don't see this behaviour. Firefox does use a hefty 250-300 MB during usage but this is normal. Can you please resubmit this bug report using apport so that we can get a better look at your system info which will help the developers greatly. Until then I am marking this incomplete.

Changed in unity:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Unity because there has been no activity for 60 days.]

Changed in unity:
status: Incomplete → Expired
Revision history for this message
jhfhlkjlj (fdsuufijjejejejej-deactivatedaccount) wrote :

Hi, can anyone on this bug report please tell me if this is due to using the HUD? There are similar reports but it's because of using the HUD with a firefox profile with a great many bookmarks.

Changed in unity:
status: Expired → Incomplete
Revision history for this message
Bèr Kessels (berkes) (ber) wrote :

I can reproduce using "only" alt, i.e. calling the HUD for Firefox.

In my case, probably related to Bug #874260. It is 100% reproducable. When I open HUD, and get bookmark-results by hitting [tab] and typing something, this always happens. When I accidentaly open HUD, because of a mistyped alt-tab, this almost always happens, depending on what I type afterwards or whether I close HUD immediately.

Attached is a screencast of this bug in action and me, explaining it.

Workaround for me: killall unity-panel-service && killall hud-service

I have 2544 bookmarks and the SQLlite file "places.sqlite" is not corrupt. The bug remains when Optimizing (VACUUM) the SQLite file.

Revision history for this message
Bèr Kessels (berkes) (ber) wrote :

I just found that the sound in my screencast in comment:4 is not working. Transcript follows:

* My TOP is showing normal activity.
* Opening firefox, I hit tab to open the HUD
* Typing something that "hits" my bookmarks, I now select a bookmark, but even without selecting one, this bug appears.
* Alt-tab to TOP. You see Firefox, HUD and panel-service hitting lots of CPU.
* If we wait for a few seconds things go back to normal.
* When I alt-tab back to firefox, and then back to TOP, it bumps up in the CPU.
* Lets do that again. Alt-tab, then top, firefox, hud and unity on top of CPU again.
* Thank you for watching.

Revision history for this message
Omer Akram (om26er) wrote :

@sladen, still happening in 12.10?

Revision history for this message
Jason Robinson (jaywink) wrote :

Affecting 12.10 here. Occasionally the unity-panel-service, hud-service and Firefox start taking massive amounts of CPU when I ALT-TAB to Firefox from another application. I cannot say what causes this to happen, but killing unity-panel-service and hud-service helps to resolve the issue. When the issue is ongoing, after ALT-TAB to Firefox from another app Firefox is unresponsive for several seconds.

Some screenshots added, one of top before changing to Firefox and one of top immediately after changing to Firefox with alt-tab.

Added also some report from ubuntu-bug unity.

Firefox and Firefox global menu versions:
firefox 17.0+build2-0ubuntu0.1 amd64
firefox-globalmenu 17.0+build2-0ubuntu0.1 amd64

Revision history for this message
Jason Robinson (jaywink) wrote :
Revision history for this message
Jason Robinson (jaywink) wrote :
Changed in unity:
status: Incomplete → Confirmed
Changed in unity:
importance: Undecided → High
milestone: none → 7.0.0
Changed in unity (Ubuntu):
status: New → Confirmed
importance: Undecided → High
summary: Alt-tab to Firefox sends Firefox to 100% CPU; unity-panel-service to 80%
- CPU and hud-server to 20-80% CPU
+ CPU and hud-service to 20-80% CPU
Revision history for this message
Jesse Johnson (holocronweaver) wrote :

The best temporary workaround is to disable the "Global Menu Bar Integration" addon. This seems to prevent the Unity HUD service from scanning the bookmarks, resolving the problem.

Revision history for this message
Dominik (dominik.k) wrote :

Maybe this bug is also related to the DBus menu problem (Bug 801699) and even related with the HUD display delay problem (Bug 1011989).

Revision history for this message
michal.gregor (michal.gregor) wrote :

You know, this is seriously inconvenient and forces users for the most part to refrain from using HUD at all. Would it perhaps be possible to provide an alternative global menu bar addon that would simply exclude bookmarks from HUD? That should be reasonably easy to implement unless I am much mistaken.

Also, if we cannot make HUD search the bookmarks efficiently, perhaps it would be possible to utilize firefox's own bookmark search, which seems to suffer from no such problems...

Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.0.0 → 7.0.1
Stephen M. Webb (bregma)
tags: added: browser-bookmarks
Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.0.1 → 7.2.0
Revision history for this message
LA (radiobuzzer) wrote :

The issue has a misleading title. The issue occurs generally when hitting the ALT key. I confirmed with Firefox 23 on Ubuntu 12.10. Lately the unity menu integration does not come as an addon. So, the previous solution (to disable the globalmenu addon if ones has high CPU load) does not work.

I found another solution, which is not optimal, but solves the problem to a certain usable extent. The problem was that there were hundreds of bookmarks in the bookmarks menu and the bookmarks toolbar. Some of them were dynamic RSS bookmarks, which means that they kept growing by the time. So HUD had to index all these bookmarks.

The solution was to move all the useless bookmarks from the bookmarks menu to the "unsorted bookmarks". The latter do not appear in the menu and therefore do not have to be indexed by HUD. After I did this, still HUD requires a little bit of loading, but it is much faster and, most important, does not halt the entire system.

I still believe there is an issue with HUD here: the entire adventure with the hundred features indicates to me that HUD's indexing is sub-optimal: it keeps re-indexing the same things that have already been indexed before, probably there is no (sufficient) caching or so. Another possibility could be a limit on the number of the bookmark items being indexed by HUD.

Revision history for this message
kapetr (kapetr) wrote :

The problem may be more difficult.

The high load - when switching between apps with Alt-Tab appears randomly.
The amount of FF bookmarks in my case is high but do not changing much. Most time I have no problems while running FF and switching to another apps - windows with Alt-Tab.
But "sometimes" happens, that high load (100% on both cores - for many seconds) occurs and stays until I kill FF and log out->in.

If it would be caused by bookmarks - then it should happen all time - the same way. Not just occasionally.

Revision history for this message
shankao (shankao) wrote :

@kapetr:

"If it would be caused by bookmarks - then it should happen all time - the same way. Not just occasionally."

Not necessarily; caching can apply at many levels.

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@radiobuzzer

"Lately the unity menu integration does not come as an addon. So, the previous solution (to disable the globalmenu addon if ones has high CPU load) does not work."

The addon, "Unity Desktop Integration", is still present in Ubuntu 13.04, and probably will continue to be in some form for the foreseeable future. Without a Firefox addon Unity has no means of using a simple API to access the bookmarks, so it is highly unlikely the addon will be replaced with some non-addon based interface. Perhaps you manually removed the addon via the package manager?

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I've been having some pretty bad firefox performance issues in 13.10, even in safe mode. It seems that if I disable the the global menu with this (in about:config):
ui.use_unity_menubar = false

then restart, performance is *greatly* improved. unity-panel-service and hud do not peg the CPU any more. Not sure why this was worse from me (guessing something in 23?) but now I can change tabs, load page, use the menu and the browser is snappy.

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@jdstrand Unfortunately on 13.04 this change did not affect Firefox cpu usage. Please create a separate bug report for the issue as I don't want to deal with it once I upgrade. =)

Revision history for this message
Pablo180 (paultait22) wrote :

13.10 newly installed and I am seeing this issue too, I didn't have it previously. If I leave Firefox and then come back firefox, hud-service and unity-panel service are maxed out, Firefox is unusable for several seconds. This also occurs when using Firefox although to a lesser degree i.e. scrolling sometimes lags, switching between tabs takes a few seconds and the page can become unresponsive. I've been using Firefox since 2004 so I also have a lot of bookmarks.

Revision history for this message
Pablo180 (paultait22) wrote :

Just to confirm what jdstrand has already said disabling Add-ons and running in safe mode makes no difference. I had to follow his advice regarding 'ui.use_unity_menubar = false' in order to stop this behaviour and gain back some battery life as a laptop with a browser that uses 100% CPU every few seconds doesn't last long.

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@paultait22 In 13.04 disabling the Unity-specific addons is sufficient to prevent bookmark scanning. Thus you bug is specific to 13.10, so you should create a separate bug report. This will make sure that the community fixes both bugs, not just one and missing the other.

Revision history for this message
Pablo180 (paultait22) wrote :

Jesse, I admit I am by no means an expert, but I don't understand, surely it is the same problem with the same causes and symptoms, but just with a different workaround?

I don't really see how 13.04 makes any difference now anyway, it hasn't been fixed and it certainly won't be fixed for 13.04; support for that release ends in three months if it hasn't in all practicality ended already?

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@paultait22 I agree that the problems are almost certainly related, but for bug fixing it is important to clarify what version resulted in what variation of the bug so that devs can look at the changes between versions and figure out where things went from bad to worse. Most developers don't have time to read the comments and aggregate all the knowledge they contain. Typically they read the initial bug report, briefly scan the comments for clues, then declare the bug fixed as long as the initial problem is solved. Since your problem has one additional condition, it is worth making a separate bug report that ALSO mentions this bug report.

Hopefully in the future launchpad will offer an option for adding bug variations so that a single report can house all the very similar but non-identical bugs under one roof.

Revision history for this message
Stephen M. Webb (bregma) wrote :

This bug describes a menu performance problem encountered in 13.04 when a browser is run with many hundreds of bookmarks.

An additional menu performance problem regarding multiple applications was introduced in Saucy Salamander and a fix for 13.10 has not yet been found. This new problem compounds the existing bookmark-related problem, and is tracked under bug #1199877.

We prefer to keep separate bugs separate, rather than mix multiple (potentially) unrelated problems together into a single bug report, because it makes tracking them and their consequent fixes much easier. Less time spent on administrative issues means more time spent on actual bug fixes.

It may turn out that both bugs have the same cause and software fix. We won't know until we fix one (or the other). Work is indeed ongoing.

Revision history for this message
Lain_13 (lain-halfbit) wrote :

Hi,

I'm using Firefox and suffered from often occasional lockups of system due to overload of both CPU cores by 2 unity-panel-service processes and hud-service. Especially often this behavior vere triggered when I tried to type a text on any forum (and that as extremely annoying). That happened pretty much often like every hour and sometimes a few times in a row.

I think I found the reason why it happened to me and finally "fixed" it.

Apperently I had ~30 RSS feeds in the bookmars menu + Feed Sidebar addon which caused them to reload every hour (not all at once but all during each hour). So, as result structure of the menu were changed every now and then. And these changes sometimes caused Unity Panel and HUD to overload system!

So, to "fix" this issue I had moved all my RSS feeds and dynamic bookmars into Unsorted Bookmarks section which does not shows up on the menu (it's actually there but only as a link to open a bookmarks manager). Seems like occasional freezes disappeared from that moment.

It's understandable that dynamic changes in the menu could require some resources but I'm pretty much sure that hoggin 100% of 64 bit dual-core CPU during 10-30 seconds is pretty much odd thing to do. At least I don't need these RSS feeds in the bookmarks menu but what will have to do those with RSS feeds on the bookmarks toolbar? Moving such feeds into Unsorted Bookmarks will totally break their workflow.

Revision history for this message
EliCoten (launchpad-elicoten) wrote :

I have just started noticing this bug since I upgraded to 13.10.

Disabling the addons made no difference, but changing the ui.use_unity_menubar to false worked well for me.

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@EliCoten Please read comments above. You are experiencing a similar but distinct bug from the one reported here. Please open another bug ticket.

Revision history for this message
Ali Najafi (alinajafi) wrote :

I’m experiencing high CPU load when switching to Firefox window (no difference by whether Alt-Tab or mouse) only when I use HUD, and the only solution is to end process of hud-service through System Monitor.
No problem afterward, or when I haven’t used HUD before.

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@alinajafi This has already been discussed at length above.

Revision history for this message
Ali Najafi (alinajafi) wrote :

@holocronweaver I thought sharing my experience is a way to confirm the bug :) sorry if I’m spamming.
Anyway, I just moved all bookmarks to Unsorted Bookmarks and will use the sidebar from now onwards. NO PROBLEMS anymore.

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@alinajafi No problemo. For the sake of keeping the signal to noise ratio down, try to only post a bug comment when you have something to add that has not already been said. If you want to +1 a bug, be sure to click the 'This bug affects you' counter at the top of the page.

Revision history for this message
Éric Piel (pieleric) wrote :

Same problem here, though it seems it have worsen recently on 13.10 (with Firefox 25?). With 5000 bookmarks, hud-service uses one CPU at 100% all the time, with a complete freeze every-time I switch a tab or firefox's window gets the focus.

By using the BookmarkMenuHider add-on to remove the bookmarks from the menu, the CPU usage goes back to 20% the time. This can be a nice workaround for computers with relatively beefy processors. You can find the add-on there:
https://addons.mozilla.org/en-US/firefox/addon/bookmarkmenuhider

Finally, the "ui.use_unity_menubar = false" fix drops the CPU usage of hud-service below 1%, and Firefox experience is back to butter smooth :-) Of course the drawback is that the menu is gone from the HUD :-(

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-appmenu (Ubuntu):
status: New → Confirmed
Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@pieleric If Ubuntu 13.10 you have, new bug ticket you should make. Related but not the same as this Ubuntu 13.04 bug, it is.

Revision history for this message
Xavier Robin (jti-533g) wrote :

@pieleric: I confirm it has gotten worse in 13.10.
The BookmarkMenuHider didn't do anything for me, probably because most of my bookmarks are sorted and thus still in the menu. after installing the addon.
The ui.use_unity_menubar trick did it, but I agree it is a pity it also disables HUD completely. Ideally the bookmarks should not be exposed to HUD, as they are already accessible through Firefox address bar (Ctrl+L).

@holocronweaver: this looks essentially like the same bug, why create a new one that is going to be closed as duplicate?

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

@xavier: I agree the bugs are similar, but they are not the same and we need to be sure both are fixed. See comment #24.

Revision history for this message
Jesse Johnson (holocronweaver) wrote :

It appears this bug is fixed in the current alpha of Ubuntu 14.04, but additional testing is needed to confirm. Please post here if you no longer experience this bug (and its variants) after switching to Ubuntu 14.04.

Revision history for this message
Henning Sprang (henning) wrote :

Affects me too!

Revision history for this message
Rolf Leggewie (r0lf) wrote :

are bug 968533 and bug 987060 possibly related?

Revision history for this message
florin (floryn-todor) wrote :

The #18 solution solve the problem for me.
(ui.use_unity_menubar = false)

Thank you. I hope this will be fixed in the 14.04 release.

Revision history for this message
Charles Kerr (charlesk) wrote :

Is anyone still experiencing this bug in 14.04?

Revision history for this message
Pellaeon Lin (pellaeon) wrote :

I still experience this in 14.04, not only alt-tab triggers this, simply switching workspaces also does.

Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.2.0 → 7.2.1
Revision history for this message
Pablo180 (paultait22) wrote :

I am no longer experiencing this after upgrading to 14.04. Seems to be fixed, at least for me.

Revision history for this message
Dennis (deki24) wrote :

hud-service is still eating up my CPU with 14.04.

Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.2.1 → 7.2.2
Changed in unity:
milestone: 7.2.2 → 7.2.3
Changed in unity:
milestone: 7.2.3 → 7.3.1
Revision history for this message
mcilya (ilya-tretyakov85) wrote :

Experiencing it on Ubuntu 14.10

Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.3.1 → 7.3.2
Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.3.2 → 7.3.3
Revision history for this message
Christopher Townsend (townsend) wrote :

Based on some of the later comments in here, I'm going to go ahead an close the Unity part of this Fix Released.

If it still occurs, then I think a new bug needs to be opened since it's most likely a different issue.

Changed in unity:
status: Confirmed → Fix Released
no longer affects: unity/7.2
Changed in unity:
milestone: 7.3.3 → none
Changed in unity (Ubuntu):
status: Confirmed → Fix Released
Changed in indicator-appmenu (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.