Memory leak when hdmi switcher is not sending data/not outputting

Bug #2006675 reported by Lowell R Holden
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-shell-extension-ubuntu-dock (Ubuntu)
New
Undecided
Unassigned

Bug Description

Main problem:
Gnome-shell has a memory leak when my hdmi switcher is on a channel that is currently not inputting hdmi (i.e. desktop on hdmi 2 but hdmi 3 is selected with nothing inserted). This memory leak does not happen if signal is being sent through the hdmi switcher either from the desktop itself or from some other device. It also does not happen if I properly turn the monitor off.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: gnome-shell 3.36.9-0ubuntu0.20.04.2
ProcVersionSignature: Ubuntu 5.15.0-58.64~20.04.1-generic 5.15.74
Uname: Linux 5.15.0-58-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.25
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Thu Feb 9 00:01:33 2023
DisplayManager: gdm3
InstallationDate: Installed on 2021-12-28 (407 days ago)
InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
RelatedPackageVersions: mutter-common 3.36.9-0ubuntu0.20.04.2
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Lowell R Holden (jda7) wrote :
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report.

Judging by your system log I am guessing that the Desktop Icons extension is the problem here. Please try disabling the desktop icons extension in the Extensions app and then log in again.

affects: gnome-shell (Ubuntu) → gnome-shell-extension-desktop-icons (Ubuntu)
Changed in gnome-shell-extension-desktop-icons (Ubuntu):
status: New → Incomplete
tags: added: gnome-shell-leak nvidia
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please also consider installing Ubuntu 22.04 as it has a newer desktop icons extension and will perform better in general.

Revision history for this message
Lowell R Holden (jda7) wrote :

I let it run for a bit, but it appears it isn't just the desktop icons. I will sleep with my set up in the state where the leak happens to fully confirm since it only has gone from 120 to 240 MB. Let me know how I can collect and post data after letting it leak for a while and I will do so when I wake up.

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

You're probably the best judge of whether the problem is fixed, given the conditions you describe are very specific. But an increase of 120 to 240MB is normal and wouldn't be considered a leak. Also remember to only look at the RSS value of the gnome-shell process.

Revision history for this message
Lowell R Holden (jda7) wrote :

I believe the memory leak still exists. It is now 1.3 GB in size. I was reporting the size given by system monitor in the processes tab, which appears to be physical memory. I don't know the best way of getting all the data, so here is the relevant data about memory size from what I got using ps aux | grep "gnome-shell"

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
ryan-li+ 2531 4.3 8.8 5815292 1445944 ? Ssl 01:02 32:02 /usr/bin/gnome-shell

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

OK, while it's that size please also collect the latest log messages from gnome-shell by:

  journalctl -b0 /usr/bin/gnome-shell > gslog.txt

and attach the resulting text file here.

It might also pay to check for any unsupported extensions in:

  ~/.local/share/gnome-shell/extensions/

That directory should either be empty or not exist.

Revision history for this message
Lowell R Holden (jda7) wrote :

The extensions directory does not exist, so I have no unsupported extensions. Here is the requested log file.

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

Your log seems to only be full of bug 1857392. It's quite unusual to see that message every 10-15 seconds so I wonder what's triggering it. Any repeating action like that can cause leaks too.

I can also see at least two leak fixes that haven't made it into 20.04 yet: bug 1876641 and bug 1962565. So the next thing you should try is disabling the Ubuntu Dock extension and then log in again.

Revision history for this message
Lowell R Holden (jda7) wrote :

Disabling that extension seems to have fixed the leak. From the start I had appindicator also disabled, would you like me to enable it to see if this set up causes appindicator to spam the log every few seconds as well? I'll attach the log from gnome-shell to show the difference.

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

Try this setting:

  gsettings set org.gnome.shell.extensions.dash-to-dock show-trash false

and then re-enable Ubuntu Dock.

Revision history for this message
Lowell R Holden (jda7) wrote :

It did not seem to do anything to relieve the issue. Attached is about an hour and 10 minutes in that state after a reboot.

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

At this stage we can't assume those log messages are relevant to the leak. Can you say how big the RSS of the gnome-shell process gets while show-trash is false?

Revision history for this message
Lowell R Holden (jda7) wrote :

%MEM VSZ RSS
11.8 6102932 1934020

Cleaned the result up manually a bit to only be the memory parts. This show that the leak is still there.

Changed in gnome-shell-extension-desktop-icons (Ubuntu):
status: Incomplete → New
affects: gnome-shell-extension-desktop-icons (Ubuntu) → gnome-shell-extension-ubuntu-dock (Ubuntu)
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.