High cpu usage on alt-tab-ing

Bug #1817620 reported by Carl-Erik Kopseng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
Expired
Low
Unassigned
mutter (Ubuntu)
Expired
Low
Unassigned

Bug Description

Switching between apps was feeling extremely laggy and unsmooth after some days of keeping the laptop on and just alt-tab-ing between apps would keep the cpu consistently at 100% when hitting it more than 8-9 times per second and *not* letting go of Alt (meaning I stay at the same app).

Some investigation (1) led me to try out restarting the gnome-shell instance (killall followed by manually starting it in the terminal), upon which everything seemed zippy again. No lagginess. The restart was a supposed fix for a memory leak bug (2), but according to the comments a bug fix was supposed to have landed in 18.04 long ago. So either this has not been fixed or this bug is about something else - probably the latter, as the reported memory usage in htop was nowhere near the gigabytes of memory reported in the bug issue for 16722297.

Another thing worth mentioning perhaps, based on comments in (3) found through (4), is that I have disabled all extensions. I used to use the Coverflow extension.

Expected behaviour:
There should be no percieved lag or stuttering in the interface when switching between applications.

Actual behaviour:
Switching between applications causes a noticable lag/stuttering when the computer has been running for an extended period of time (weeks, but where it has mostly been suspended, meaning actual usage is limited to 3-4 days).

1. https://www.omgubuntu.co.uk/2018/03/gnome-shell-has-a-memory-leak-and-it-might-not-be-fixed-for-ubuntu-18-04-lts
2. https://bugs.launchpad.net/gnome-shell/+bug/1672297
3. https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1773959
4. https://askubuntu.com/a/1090987/165026

System info:
------------
Running Wayland.

Description: Ubuntu 18.04.1 LTS
Release: 18.04

gnome-shell:
  Installert: 3.28.3-0ubuntu0.18.04.4
  Kandidat: 3.28.3-0ubuntu0.18.04.4
  Versjonstabell:
 *** 3.28.3-0ubuntu0.18.04.4 500
        500 http://no.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.28.1-0ubuntu2 500
        500 http://no.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

edit: removed info on high cpu usage when using mouse. supposedly unrelated.

tags: added: bionic performance
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Performance of window previews is significantly improved in mutter 3.28.4 (which doesn't exist yet :) due to:

  https://gitlab.gnome.org/GNOME/mutter/commit/d81dcd13e4e14a8c80b7c9d475feb58c258babc0

But I think 18.04 will get that fix soon as part of the proposed update:

  https://launchpad.net/ubuntu/+source/mutter/3.28.3+git20190124-0ubuntu18.04.1

Gnome 3.30 (Ubuntu 18.10) onward already contains that fix. So could you please test one of:

 * Ubuntu 18.10
 * Ubuntu 19.04
 * Ubuntu 18.04 with proposed updates enabled

and tell us the version of the 'mutter' package you are testing.

Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also, please run this command to send us more information about the affected machine:

  apport-collect 1817620

Changed in mutter (Ubuntu):
status: New → Incomplete
Revision history for this message
Carl-Erik Kopseng (carlerik) wrote :

Thanks for the reply. I'll run Apport as soon as I can access the machine again.

Regarding the actual issue, I don't think it is as cut and dry as this being just about rendering alone, as that would imply that the rendering performance was consistently bad. As I wrote, the performance seems fine on a fresh boot and also after restarting gnome-session (once the bug has appeared), which would not be the case if this was down to just rendering. Some kind of memory issue (leak, fragmentation, ...) seems to play a part in order to explain the time component.

Also, there is no window preview (which I assume is a small boxed window preview when Alt-Tab-ing) when I have disabled the Coverflow plugin, yet the stuttering performance was very much present.

When it comes to testing out the issue with 19.04, you'll have to bear with me, as this issue takes some time to materialize :-) I have not been able to reproduce it in a short time.

Are there any debugging tools I can employ to gain some insight/stats/vitals if/when I encounter this issue?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think this bug is very clear already. It really requires someone (most likely future me) to do some profiling on the primary test case:

> just alt-tab-ing between apps would keep the cpu consistently at 100% when hitting it more than 8-9 times per second and *not* letting go of Alt (meaning I stay at the same app).

Also, there's a secondary issue you mention:

> Also, just whizzing the mouse around on the screen (not moving anything) would keep the cpu at 40-50%.

Please remove that from the description because it's a different bug (https://gitlab.gnome.org/GNOME/mutter/issues/283).

Revision history for this message
Carl-Erik Kopseng (carlerik) wrote :

OK, removed. Just found it weird that both issues disappered by restarting `gnome-shell`, so assumed they were related by some root cause. Thank you.

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

[Expired for mutter (Ubuntu) because there has been no activity for 60 days.]

Changed in mutter (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gnome-shell (Ubuntu) because there has been no activity for 60 days.]

Changed in gnome-shell (Ubuntu):
status: Incomplete → Expired
Changed in gnome-shell (Ubuntu):
status: Expired → New
Changed in mutter (Ubuntu):
status: Expired → New
Changed in gnome-shell (Ubuntu):
importance: Undecided → Low
Changed in mutter (Ubuntu):
importance: Undecided → Low
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please try:

(1) Updating your system, since the fix mentioned in comment #1 should now be included in 18.04 updates. Maybe this bug has been fixed.

(2) If you do restart gnome-shell and find that improves performance, then wait another 30 seconds or more and retest. Does it get slower again after 30 seconds?

Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Changed in mutter (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for mutter (Ubuntu) because there has been no activity for 60 days.]

Changed in mutter (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gnome-shell (Ubuntu) because there has been no activity for 60 days.]

Changed in gnome-shell (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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