I'm seeing something very similar.
Did a fresh install of 20.04 a week ago.

After being logged in half a day things really start slowing down.
Alt+Tab takes a few seconds to pop up, then you tab through to e.g. an
open Calculator instance and that takes 8 seconds to come to the
foreground.  gnone-shell using 50% of one CPU.

Have tried your suggestions to no avail.

attaching the logs requested.  journalctl shows a tone of javascript errors
e.g.
JS ERROR: TypeError: null has no properties
                                          
_onFocusChanged@resource:///org/gnome/shell/ui/closeDialog.js:135:9


$ sudo strace -c -p 7087
strace: Process 7087 attached
^Cstrace: Process 7087 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 34.73    0.215539           2     98592           sendmsg
 23.99    0.148891           2     70929     36904 recvmsg
 22.68    0.140739           2     68317           poll
 16.42    0.101903           2     34030           writev
  1.21    0.007527           4      1716           ioctl
  0.46    0.002841           3       932       138 futex
  0.25    0.001521           5       300       260 stat
  0.10    0.000590           0       656           mprotect
  0.06    0.000362           0      1165           write
  0.04    0.000278           5        54           munmap
  0.03    0.000205           0       305           getpid
  0.01    0.000089           0       383           read
  0.00    0.000022           1        13           timerfd_create
  0.00    0.000017           1        13           close
  0.00    0.000017           1        10           mmap
  0.00    0.000017           1        13           timerfd_settime
  0.00    0.000002           2         1           restart_syscall
  0.00    0.000000           0         2           getrusage
------ ----------- ----------- --------- --------- ----------------
100.00    0.620560                277431     37302 total


Your journalctl command produced a 1.5Gb file.  I have attached the last 100K 
lines.  Let me know if you need more.

** Attachment added: "journal-tail.txt"
   
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1880723/+attachment/5393304/+files/journal-tail.txt

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-shell in Ubuntu.
https://bugs.launchpad.net/bugs/1880723

Title:
  gnome-shell high CPU usage on Ubuntu 20.04

Status in gnome-shell package in Ubuntu:
  Incomplete

Bug description:
  After having a couple of terminals and and Chrome windows open for
  most of the day, everything becomes sluggish. Switching desktops is
  clearly very slow and Chrome's windows don't react to all mouse
  actions.

  Looking at htop I can see gnome-shell takes anywhere between 5% and
  50% of CPU, normally between 10% and 20%.

  With Chrome and terminal windows open, an strace on the PID of gnome-
  shell shows the following:

  jpmeijers@jpmeijers-XPS13-9333:~$ sudo strace -c -p 3491
  [sudo] password for jpmeijers: 
  strace: Process 3491 attached
  ^Cstrace: Process 3491 detached
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
   36.37    0.108651           3     30932     16434 recvmsg
   34.99    0.104531           3     29278           poll
   26.20    0.078272           5     14601           writev
    1.06    0.003158           2      1181           ioctl
    0.35    0.001041           2       430           write
    0.27    0.000812           1       602           getpid
    0.26    0.000773           4       158           read
    0.11    0.000316           3        96           timerfd_create
    0.10    0.000313           3        96           close
    0.10    0.000300           4        73         4 futex
    0.08    0.000241           2        96           timerfd_settime
    0.07    0.000201           0       228           mprotect
    0.04    0.000111          27         4           getrusage
    0.01    0.000038          12         3           sendmsg
    0.00    0.000008           0        11           munmap
    0.00    0.000005           0         6           mmap
    0.00    0.000002           1         2         1 recvfrom
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.298773                 77797     16439 total

  
  After closing Chrome windows:

  jpmeijers@jpmeijers-XPS13-9333:~$ sudo strace -c -p 3491
  strace: Process 3491 attached
  ^Cstrace: Process 3491 detached
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
   36.24    0.099458           3     30319     15900 recvmsg
   35.15    0.096450           3     29053           poll
   26.86    0.073711           5     14500           writev
    0.68    0.001858           1       930           ioctl
    0.40    0.001092           3       318           write
    0.14    0.000386           6        64           close
    0.13    0.000344           0       469           getpid
    0.11    0.000295           4        64           timerfd_create
    0.11    0.000292           1       222           mprotect
    0.06    0.000177           2        64           timerfd_settime
    0.06    0.000153           6        25           munmap
    0.04    0.000121           1       121           read
    0.01    0.000038           0        49         4 futex
    0.01    0.000018           6         3           sendmsg
    0.00    0.000013          13         1           restart_syscall
    0.00    0.000000           0         7           mmap
    0.00    0.000000           0         2           getrusage
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.274406                 76211     15904 total

  
  After closing the terminal windows too, therefore only the terminal running 
strace is open:

  jpmeijers@jpmeijers-XPS13-9333:~$ sudo strace -c -p 3491
  strace: Process 3491 attached
  ^Cstrace: Process 3491 detached
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
   36.43    0.196569           3     54115     27576 recvmsg
   35.25    0.190224           3     53266           poll
   26.92    0.145275           5     26592           writev
    0.30    0.001631           4       405           write
    0.23    0.001245           5       248           mprotect
    0.23    0.001229           9       136           close
    0.21    0.001120           1       621           ioctl
    0.16    0.000889           6       136           timerfd_create
    0.13    0.000711           5       136           timerfd_settime
    0.06    0.000328           1       300           getpid
    0.03    0.000180           2        68         3 futex
    0.03    0.000159           1        85           read
    0.01    0.000053           8         6           sendmsg
    0.01    0.000027           3         9           mmap
    0.00    0.000002           0         3           munmap
    0.00    0.000002           0         4           getrusage
    0.00    0.000000           0         1           recvfrom
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.539644                136131     27579 total

  
  I see the calls and errors to recvmsg climbing. What does this mean, and what 
is causing this?
  --- 
  ProblemType: Bug
  ApportVersion: 2.20.11-0ubuntu27
  Architecture: amd64
  CasperMD5CheckResult: skip
  CurrentDesktop: ubuntu:GNOME
  DisplayManager: gdm3
  DistroRelease: Ubuntu 20.04
  InstallationDate: Installed on 2020-04-25 (31 days ago)
  InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
  Package: gnome-shell 3.36.2-1ubuntu1~20.04.1
  PackageArchitecture: amd64
  ProcVersionSignature: Ubuntu 5.4.0-31.35-generic 5.4.34
  RelatedPackageVersions: mutter-common 3.36.2-1ubuntu1~20.04.1
  Tags:  focal
  Uname: Linux 5.4.0-31-generic x86_64
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: adm cdrom dialout dip docker lpadmin lxd plugdev sambashare sudo
  _MarkForUpload: True

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1880723/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to