Ubuntu – Gnome 14.10 memory leak, over 5gb of gnome-shell

gnomememory leakswap

I am experiencing a pretty huge memory leak from gnome-shell and after a while memory is up to over 5GB. I have 8GB of system memory and when the system starts using swap the whole system slows down a lot. I do have a SSD but that doesn't make matters better. I have changed the swap settings to 1 but that has no effect. I regularly kill gnome-shell off to be able to use the system. I came from Unity where system-ram was used quite heavily and swap was sometimes used as well. My solution was to up ram from 4GB to 8GB and to change to GNOME, but it seems I still have the same problem 🙁

Any ideas how to limit gnome-shell ram usage? Any program that can kill off gnome when it exceeds 4GB for example? I don't really know what to do except try Unity again or change to Xubuntu or such. I do really like GNOME though…

Best Answer

gnome-shell leaks memory like a colander.

There is a bug reported here (it's for Mint but it's the same problem) and on redhat.

Upstream there are at least 9 bugs reported.

Basically (one developer told me once, I can't find the reference) gnome-shell is completely unable (by design) to control the memory usage of its extensions. Add this to the fact that there is no API documentation for writing them (at least, I could not find it when I wrote mine) and well... leak happens.

In my case, I had to remove a couple of extensions (sensors and weather were the main culprits) that made the shell grows like crazy. Even now, every now and then I have to restart the shell with Alt-F2 and r to get it back to its normal size (and then you have to cope with gnome-terminals going crazy...).

Practical solution:

  1. remove all extensions, look at the memory usage, and add them one by one to find the worst offender(s).

  2. gnome-shell still leaks memory by itself, or you really need some extensions. So I do every now and then (basically every morning, my PC is normally on 24/7):

  3. kill gnome terminals to avoid the bug above (in 14.04-shell 3.10; should be fixed in newer shell), by doing from one of them:

    killall gnome-terminal 

    and reset the shell with Alt-F2 and r

PD: I know, there are others DEs. But I like gnome-shell, call me crazy...

Related Question