Ubuntu 19.10 Gnome Shell Memory Leak

I recently cobbled together an AMD 3950X, Aorus Master x570 and 64G of ram. I’m quite happy with it but there is a significant memory leak with gnome shell. Within a matter of hours it goes from 200mb to 1.2G of memory usage and then the system sometimes just freezes.

This is a clean install btw.

I was waiting to write this post until I could at least point to something which was causing it.

And this morning I found it – touching or moving windows. That’s it. When I boot into Ubuntu and open the System Monitor I can see the gnome-shell taking up ~200mb of memory. If I leave it alone it pretty much remains static (have only done that for an hour but it doesn’t increase ram usage in that period). If I suddenly touch a window and bring it to the foreground then gnome-shell instantly jumps anywhere from 1-10mb in memory usage. Moving Firefox around, switching workspaces etc. Just opening Gnome Maps causes it to jump 40mb. Same thing for Handbrake.

Closing the apps does not release the memory, it keeps increasing. Relaunching maps or handbrake causes gnome-shell to take even more memory.

At some point I seem to hit a threshold where gnome-shell just increases on its own by 200kb every 5 seconds – pretty soon I’m over 1G and having to restart gnome-shell before the system freezes (cursor and keyboard freezes)

Oddly, my sons Ubuntu 19.10 does not do this. I performed a clean install on that hardware as well (2700x). gnome-shell never goes over 250mb on his setup, I can launch and move anything and it generally stays at 245mb.

However, a colleague who also uses Ubuntu 19.10 has noticed the exact same behaviour on his 2990WX. He went a little further in his testing and decided to install Linux Mint and the leaking stopped. He then installed Ubuntu Mate and the leaking also stopped, he returned to Ubuntu 19.10 stock install and immediately saw gnome-shell jump over 1G within a few hours. He’s back to Mate now and staying there.

I’m currently waiting this issue out until 20.04 where I plan to stick with the LTS. However, if there is some kind of logging I can do to in order to submit a bug report I’d be eager to learn about it. Short of recording a video with OBS I’m not entirely sure what to do here (other than restarting gnome-shell every 60mins)

Edit: lots of spelling…

Ok, so I’m not nuts. This memory leak has been around for almost 2 years. Here’s a video of it affecting someone else – this is exactly what I’m seeing in Ubuntu 19.10 on the 3950X:

Before we start troubleshooting:

How much important it is to you to stay on standard Ubuntu?

EDIT: fuck even I couldn’t understand my question, here it goes again:

How important is to you to stay on standard Ubuntu?

I run pop!_os 19.10, Ubuntu 19.10 base, and they fixed the memory leak.

I’m not particularly wedded to Ubuntu but I do like it, if I have to I can switch to Mate.

But now that I know I’m not crazy I’ll wait for 20.04 and see how that works out. It bugs me that the exact same USB3 installer on my sons machine works fine but on my hardware it leaks. It’s also really messed up that this gnome-shell memory leak is several years old – some forums now joke that it’s a feature.


I wish I could do a strike through on some text. I just discovered that this bug affects more than just Ubuntu and has been seen in Fedora as well.

I tested Ubuntu for 18months before building my sons machine and then waited an entire year before building mine. I’m a little shocked to be discovering this issue only now, it seems to be fairly well documented.

1 Like

Use XFCE :smiley:

Try installing mate and nuking gnome from your install

You don’t need to change distro or reinstall. Just switch DE and see if it solves your problem

1.2Gb of memory use for Gnome3 is pretty normal?

Well of course if you are fed up with it,
you could also go with the Cinnamon desktop for example.
If you want to keep it looking modern.
Maybe Linux Mint might work well for you there.

Another thing you could of course try is Kubuntu.
KDE plasma desktop has come a long way and is pretty nice now days.

I’m running Ubuntu Mate on one of my laptops with only 4GB or memory,
and never really had any issues with that in regards to memory.
But it does look a bit dated.
Of course there are plenty of things you could do about that.
But still, it has that vintage look and feel around it.

This is nuts. I’ve been tearing my hair out since yesterday dealing with a stream of new problems including not being able to shut down my machine. Trying to shut down would simply jump back to the lockscreen and shortly thereafter display the Ubuntu logo with the dots going through a cycle animation.

I ended going to bed at 2am and left the machine in that state until this morning only to find it in the same state. I hard rebooted.

I just spent the last 4 hours in the terminal and grub with no effect. The only thing that works is:

sudo poweroff -f

Then I decided to work backwards and uninstall the most recently installed apps … I’ll spare the details but the culprit was gnome-boxes v3.34.1-1 (not the very latest but this is the one found in the ubuntu software app).

The minute I uninstalled that particular not only was I able to shut down properly but the memory leak in gnome-shell stopped.

Absolutely bonkers.

1 Like

are you on a nightly build or something?

that’s some hefty breakage, my friend…

Nothing out of the ordinary, I think it’s pure coincidence. After a few hours I noticed the memory leak returned but it’s much slower than before.

As for not being able to shut down, well, based on a glimpse I had from a single line which was output to the screen I’d say that gnome-boxes was under the impression that a vm was running and preventing the host from shutting down. This post seems to validate my hypothesis:

This is entirely unexpected behaviour (as a Mac guy) but it actually makes sense. What would make even more sense is if this stuff was more obvious in the UI. After 25 yrs of pretty icons on the Mac giving the the status of things I find it jarring trying to decipher verbose logging as it flies across the screen. I’ll get there …

Gnome is famous for gnome’ing people

It’s a fine welcome (read “fine” as Wendell generally says It)

Try installing another DE on top of your install (make a backup just in case tho) and see if you like it.

I want to update this thread to state I was wrong in my assumptions. I think deleting gnome-boxes had a superficial effect in that Ubuntu behaved properly for about a day before returning to its crashy & memory leaking state. At the moment I can’t leave the box running for more than an hour without forcing a shutdown with “poweroff -f” (because it hangs if I try to shutdown via the gui).

I guess I’ll be testing Ubuntu 18.04 or MATE this weekend. I was hoping to limp along until April for 20.04 but gnome-shell in 19.10 is making my environment unusable.

It’s been slightly over a week now, here’s an update to close this thread …

The system became unstable shortly after my last reply and I was forced to run “poweroff -f” 5 or more times during the day. Shutting down was impossible as the system would pop me out to the lockscreen where I could then read a bunch of verbose logging details.

A recurring log was an obscure message stating “…running guests under URI address default: no running guests” but I had no idea what this meant at the time (it’s related to QEMU/KVM which is installed with Ubuntu by default).

The memory leak issue was now reaching 1G within an hour and the system would simply freeze. Pressing Alt + F2 to restart gnome-shell only seemed to expedite the inevitable crash.

After a scorched earth OS reinstall I was able to shutdown normally again but the memory leak remained. However, last week there was a fairly large update from Canonical which thankfully semi-plugged the gnome-shell memory leak. I can through the day and it only grows to ~700MB. Obviously the leak is still there but it’s been tempered. I have been slowly reinstalling my apps and paying attention to the memory usage afterwards and so far have not seen the leak get worse (ie, I’m trying to find correlation with something I had installed on the previous config).

And finally, while the libvirt-guests was not preventing me from shutting down my computer the bizarre logging did return. Whenever I shutdown I see the “…running guests under URI address default: no running guests” briefly before the system shuts off.

QEMU/KVM are installed by default and while I do use it I never added/removed/configured it beyond what was preinstalled with Ubuntu.

I opted to shut down the libvirt-guests service as I had found others with the same issue:

sudo systemctl disable libvirt-guests

The system shuts down nicely now without any verbose logging. However, this post says shutting down libvirt-guests is not a solution and that the underlying cause is still there.


At least the system is usable.