15

I am using Ubuntu 17.10 with the default Ubuntu desktop (no extensions added) and my computer has 4 GB of RAM. I noticed that every time I use Gnome Shell, either by pressing the Super key, Super+A, Super+Tab or by clicking an element on the top bar, the RAM usage of the gnome-shell process increases by a couple of MB. This doesn't seem much of a problem, but after some hours of work gnome-shell usage climbs higher than 1.5 GB, with the total RAM usage being close on 4 GB. Then swap is starts getting filled up, making my computer extremely slow.

Does anyone else notice the same behavior? Why does gnome-shell memory keep adding up? Is there a way to clear gnome-shell memory usage other than logging out?

8
  • 2
    I guess there is no solution until Gnome team decide to optimize a bit more their environment. I'm using Gnome since years now, and I have the same behavior.
    – ob2
    Nov 1, 2017 at 9:24
  • 14
    Sometime, I use ALT+F2 and then just type "r" in the execute command, this reload Gnome Shell a free up few memory.
    – ob2
    Nov 1, 2017 at 11:19
  • 2
    It's a pity that this does not work in Wayland. Nov 2, 2017 at 10:35
  • 1
    This is a bug I recommend that you follow up on it here
    – Elder Geek
    Nov 26, 2017 at 17:46
  • 1
    Another way it to send a signal hang up to gnome-shell, killall -SIGHUP gnome-shell
    – naisanza
    Feb 9, 2018 at 4:21

1 Answer 1

2

Several years later and after the question was closed and reopened, I have a pretty good idea of what the issue was. So I'm answering my own question.


Does anyone else notice the same behavior? Why does gnome-shell memory keep adding up?

The issue was due to the infamous GNOME Shell memory leak that was plaguing GNOME Shell since before Ubuntu 17.10. There was a bug report for the issue that dated back to 13/03/2017, but the issue probably existed even before that.

A GNOME developer (Georges Basile Stavracas Neto) went on in 2018 to find the cause of the leak and found that it was related to Garbage Collection. The fix was released later that year for both Ubuntu 18.04 and 17.10.

I have not observed any more severe memory leaks like this since the fix was released. Some mostly minor memory leaks have been observed by other users though, as one can see in the linked bug report above, but they are attributed to different causes.


Is there a way to clear gnome-shell memory usage other than logging out?

On an Xorg session, restarting GNOME Shell by pressing Alt+F2, entering r, and pressing Enter would suffice to clear the leaked memory and restore the computer to a usable state. Restarting GNOME Shell on Xorg is still a good way to solve a multitude of problems.

However, it was not (and still isn't) possible to restart a Wayland session in a similar way, thus the only to solve the issue at the time on Wayland was to log out and log back in.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .