Score:0

gnome-shell excessive CPU usage / slowness on tracePersistentRoots

tr flag
ash

In the last few days, gnome-shell has started performing very poorly. The UI becomes very slow, and eventually almost unusable with a lag between clicks and response taking a few seconds.

The symtomps do not start immediately, but within a few minutes. Killing the process, or restarting it (using ALT-F2 and entering r), the usage (usually) recovers - at least to the point that the rest of the UI is usable again. But it does not last long - maybe a couple of minutes.

Looking at top, the memory usage of the process is high and keeps growing - up over 1gb RES and 5gb VIRT.

Using sysprof, the following are coming up as high usage (sampled for about 30 seconds):

  • In file /usr/lib/x86_64-linux-gnu/libmozjs-68.so.68.6.0 (80%) (475,502 hits)

    JSRuntime::tracePersistentRoots(JSTracer*)

  • In file /usr/lib/x86_64-linux-gnu/libgjs.so.0.0.0 (10%) (48,068)

Note that the libgjs does not have a single large call, although tracePersistentRoots is up near the top with 0.55% usage.

All gnome extensions should-be disabled.

This is Ubuntu 20.04. Gnome Shell version 3.36.9-0ubuntu0.20.04.2.

Any help tracking this down is greatly appreciated.

heynnema avatar
ru flag
What do you mean *"All gnome extensions should-be disabled"*? Start `terminal` and type `top`. With no activity, or mouse/keyboard activity, tell me how much CPU% gnome-shell is taking... it should be < 4%... and/or show me a screenshot. Edit your question and show me `ls -al ~/.local/share/gnome-shell/extensions` and `ls -al /usr/share/gnome-shell/extensions`.
Score:0
tr flag
ash

I tracked the cause back to a process spamming notifications. In this case, that was "back in time" repeatedly complaining about the target being out of disk space.

Since "do-not-disturb" was on, I didn't see the notifications. Changing to XFCE for a few hours, the notifications started popping up, and made it clear. Going back to Gnome and starting/stopping the backup, the problem was easily reproduced.

Also, clicking on the clock to see the list of notifications locked up the UI, which is consistent with the notifications being overloaded.

Would be great to have some way to identify this condition more clearly, but at least now I know to watch for this problem.

Hope this helps others.

Note too that turning off the "Enable Notifications" setting in "back in time" did not help.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.