Submit News Alternative Tip Form

Umm, GNOME Shell Has a Rather Big Memory Leak

Ruh-oh

squish da bug

squish da bug

And here I was thinking it was just me — it turns out there’s a rather annoying memory leak in GNOME Shell, a leak which is unlikely to be fixed in time for the release of Ubuntu 18.04 next month.

I use a vanilla Ubuntu 17.10 install at the moment and do enjoy using the default GNOME Shell desktop. It’s nice, especially with a few extra extensions.

Now, I had assumed that an issue I had with GNOME Shell gobbling up large amounts of memory the longer I used it was down to my configuration or hardware; i.e. that I was at fault.

But it turns out that I’m not. In fact, a lot of other GNOME Shell users on various different Linux distributions also experience similar performance related issues while using GNOME Shell.

What’s happening?

GNOME Shell 3.26 Memory Leak

A number of Ubuntu users have reported that GNOME Shell 3.26.2, the version used in Ubuntu 17.10, has a “sneaky leak” that causes GNOME Shell’s memory usage to increase every minute following a Shell animation (like opening the overview, switching windows, minimising to dock).

It’s a bug that’s hard to avoid as just “using” the desktop normally causes huge amounts of memory is consumed by GNOME Shell within hours.

Maxed out RAM is not great for productivity, or for getting a decent battery life on laptops.

Admittedly bug reports don’t tend to count those who aren’t affected. This issue could be pretty niche, or it might be that those with a lot of RAM don’t “notice” any ill effects resulting from this issue at all.

But on systems with low amounts of memory the effects of the leak are likely to be more pronounced, appearing as a slow, sluggish system.

GNOME Developers are aware, and working to fix it

As mentioned, it seems the issue is not specific to Ubuntu.

A similar bug report is open on Gitlab, where GNOME developers are actively working on tracking down the exact cause.

Developer Georges Basile Stavracas Neto did a bit of digging on the issue, highlighting a number of triggers he discovered:

  • GNOME Shell consumes ~70MB right after starting up;
    • Jumps to ~95MB after opening the aggregate menu popup;
    • Jumps to ~250MB after loading the icon grid (with ~90 icons);

Georges adds that the memory leak in question is not specific to opening the Overview screen (as many had initially assumed) but can occur following any GNOME Shell animation, such as:

  • Press and hold <Alt>Tab with 3+ apps, and see the memory consumption increasing;
  • Press repeatedly <Meta> with 3+ apps, and see the memory consumption increasing;
  • Open and close any menu repeatedly, and see the memory consumption increasing

And so on.

You can see this GNOME Shell memory leak in action in the video below. The uploader demoes it on Fedora, suggesting it’s not an Ubuntu-specific problem.

The bad news? The issue is still present in GNOME Shell 3.28…

Although GNOME developers have issued a “fix” for the issue it, according to user reports, fails to plug the

From comments on the bug reports tracking the issue it appears the memory increase issue is still present in the latest daily builds of Ubuntu 18.04 LTS, which uses the newer GNOME Shell 3.28 release by default.

With Ubuntu 18.04 LTS in the final stretches of development it’s unlikely that any patch or fix will be ready by the time of its release on April 26, 2018.

But don’t despair.

It is possible that a fix for the memory leak could feature as part of a future GNOME 3.28 point release, or come as part of the GNOME 3.30 release in October. Ubuntu developers could cherry pick the patch, back port it, and push it out to Bionic users at a later date.

Workaround

Regardless of when/if it’s fixed there is also a workaround for those affected.

If you plan to use the GNOME Shell desktop in Ubuntu 18.04 LTS (of suffer from the leak on 17.10) you may forcibly restart GNOME Shell every couple of hours to free up memory. This is easy to do:

  1. Press Alt + F2
  2. Type the letter ‘r’
  3. Hit Enter/Return

Are you affected?

As I said at the start of this post, I assumed that I was the only one experiencing an issue. These bug reports suggest the issue is more widespread.

Do you use GNOME Shell 3.26 or 3.28? Do you experience memory issues like this reported? Share your thoughts in the comments below.