Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#32484 - [gtk3] memory leak Gnome 3.6.1

Attached to Project: Arch Linux
Opened by Anthony Ruhier (Anthony25) - Monday, 05 November 2012, 21:49 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 03 October 2013, 13:45 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ionut Biru (wonder)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 13
Private No


The gnome-shell process ask for more than 400mo of RAM after a while (it asked 150mo max with gnome 3.4). I have seen that memory consumption increases when I click on anything in the top bar (like date, username, etc...) but doesn't decrease.

Additional info:
* gnome-shell 3.6.1
* Linux 3.6.5

Steps to reproduce:
Click quickly and many times on an element in the top bar (like the username or the date) and see the memory consumption increases very fast.
This task depends upon

Closed by  Dave Reisner (falconindy)
Thursday, 03 October 2013, 13:45 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 3.8.x
Comment by Anthony Ruhier (Anthony25) - Monday, 05 November 2012, 21:51 GMT
Information maybe useful : I am running on an intel graphic chipset (sandy bridge) with bumblebee.

And I have the same problem for the Activites menu.
Comment by Christoph Seitz (go2sh) - Tuesday, 06 November 2012, 10:30 GMT
I can reproduce it. My memory usage was going from 150M to 450M just with clicking 30 sec. Every click on the username add approx. 4M.

Also Sandy-Bridge Intel-Graphics.
Comment by Jan de Groot (JGC) - Tuesday, 06 November 2012, 10:52 GMT
Can you try downgrading GTK to 3.6.0?
Comment by Anthony Ruhier (Anthony25) - Tuesday, 06 November 2012, 18:20 GMT
The gtk3-3.6.0 package hasn't been set in Arch, so I can't find it in ARM.

I will try to find the sources to compile it.

Edit : I asked someone who just passed to gnome 3.6 to test if he had the same problem as us (to test with an other graphic card), and with a Nvidia 260GTX it's the same thing.
Comment by Pedro Martinez-Julia (pedromj) - Tuesday, 06 November 2012, 19:17 GMT
The same happens to me, but gnome-shell reserved memory still increases to more than 1 GiB. I need to restart the shell (alt+f2 r) from time to time to prevent make my system usable :(.
Comment by Pedro Martinez-Julia (pedromj) - Wednesday, 07 November 2012, 00:24 GMT
As an additional note, I see the following messages in "~/.cache/gdm/session.log" (which was .xsession-errors):

(gnome-shell:482): Clutter-CRITICAL **: clutter_text_get_editable: assertion `CLUTTER_IS_TEXT (self)' failed
(gnome-shell:482): Clutter-CRITICAL **: clutter_text_get_text: assertion `CLUTTER_IS_TEXT (self)' failed
(gnome-shell:482): Clutter-CRITICAL **: clutter_text_set_text: assertion `CLUTTER_IS_TEXT (self)' failed

It may be related or not but it is the only error I can see. These messages are repeated a lot of times. In my last session I have around 16 MiB of messages and gnome-shell got 500 MiB.

Seeing the release dates of clutter-gtk 1.4.0 and clutter 1.12.2 I have the theory that gnome-shell 3.6 has not taken into account something that changed in clutter.
Comment by Anthony Ruhier (Anthony25) - Wednesday, 07 November 2012, 07:46 GMT
I will test to downgrade clutter to the 1.12.2 version, and check my log.

Thanks ! ;)
Comment by Juan Donadio (LoKi) - Wednesday, 07 November 2012, 11:53 GMT
I've the same problem. It seems to be a problem with GTK:
I set the Adwaita theme without animations and no more problems! (at the moment) :)
Comment by Pedro Martinez-Julia (pedromj) - Wednesday, 07 November 2012, 12:08 GMT
This bug report covers the memory grow of gnome-shell. The other bug reports comment a memory leak in GTK that affects to applications (gedit, file-roller). I tried to reproduce the other bugs without success, so I think it is not the same bug. I'm using the default Adwaita theme.
Comment by Pedro Martinez-Julia (pedromj) - Wednesday, 07 November 2012, 13:42 GMT
I noticed that the clutter related messages I previously reported start to appear in ~/.cache/gdm/session.log" after cycling through the screen locker. I also confirmed that, when those messages appear (after the screen locker has entered and exited), the memory consumption of "gnome-shell" starts to increase without other reason.

This makes me think in the "animations" bug, because the screen locker does have animations. Could it be related?
Comment by Ondrej Jirman (megous) - Thursday, 08 November 2012, 22:46 GMT
There were some memleaks fixed 2 days ago in gtk+, including in animations, and background gradients code (reported as a huge one).
Comment by Pedro Martinez-Julia (pedromj) - Thursday, 08 November 2012, 22:53 GMT
I have just installed the updated "gtk3" package. I hope to confirm, in a few days, that the "gnome-shell" memory leaks are fixed.

NOTE: The messages I noticed in "~/.cache/gdm/session.log" about clutter was related to a malfunctioning extension, but they only appeared when the extension was disabled (what now happens now when the screen is locked). I've fixed the extension and they do not appear anymore.
Comment by Anthony Ruhier (Anthony25) - Thursday, 08 November 2012, 22:59 GMT
I just had an update for gtk3.

Actually the memory leak is minimized, but still there for me...

Edit : changelog for the last gtk3 update :
It seems this update might fix the bug, but it's not working totally for me.
Comment by Green (The_Green_Arrow) - Sunday, 11 November 2012, 14:04 GMT
I can confirm this issue even with the latest version of gtk3 (3.6.1-2)...
(xorg 1.12, catalyst 12.6-2 driver)
Comment by Anthony Ruhier (Anthony25) - Monday, 12 November 2012, 09:33 GMT
I have tested on a other computer, running on Ubuntu 12.10 with gnome 3.6, the memory leak is there too !

I will report this bug to the gnome team (if anybody have not already done it).

Edit : few memory leak reports have already been done on the gnome bugzilla, I've just added a comment to explain how to see quicker the bug (click many times on an element in the top bar).
Hoping it will help solving the problem !
Comment by Anthony Ruhier (Anthony25) - Thursday, 15 November 2012, 13:57 GMT
The bug report on the gnome bugzilla about the memory leak doesn't seem to move, I hope devs are aware about this bug...
Comment by Greg (dolby) - Saturday, 17 November 2012, 09:29 GMT
What report? Please post a link here.
Comment by Bree Cummins (breecummins) - Saturday, 17 November 2012, 20:15 GMT
I have this bug also, and found the bugzilla bug report here: The assigned dev seems to think it's an nvidia bug, but I have the bug even with a Radeon card. I added a comment to the bugzilla report. I am running gnome-shell 3.6.2 with kernel 3.6.6 on a Lenovo Thinkpad X100e.
Comment by Pedro Martinez-Julia (pedromj) - Saturday, 17 November 2012, 20:19 GMT
I can confirm that the bug also affects to Intel cards. I'm running gnome-shell 3.6.2 with an Intel GM45 card and gnome-shell memory consumption reaches 500 MiB and continues. I use to kill it from time to time in order to prevent the system to be unstable.
Comment by Anthony Ruhier (Anthony25) - Saturday, 17 November 2012, 23:11 GMT
@Greg The one Bree Cummins posted ;)
Comment by Anthony Ruhier (Anthony25) - Saturday, 17 November 2012, 23:24 GMT
@Bree Cummins : This memory leak isn't linked to the graphic card, like I said I tested on Ubuntu 12.10 with Gnome-shell 3.6 and an Nvidia card, there is the same bug as on my laptop with an intel GPU (Sandy Bridge).

Maybe we have to open a new bug report on the gnome bugzilla to make things clear ?
Comment by Bree Cummins (breecummins) - Sunday, 18 November 2012, 02:31 GMT
@Anthony Ruhier: I'm afraid it would just be a duplicate bug report.
Comment by Anthony Ruhier (Anthony25) - Tuesday, 08 January 2013, 20:19 GMT
2 patches have been committed :

I will try in few hours and I will tell you if it fix the problem for me ;)
Comment by Anthony Ruhier (Anthony25) - Tuesday, 08 January 2013, 21:15 GMT
I tried to apply the 2 patches, but for the first one I do not know what sources I have to patch, the second one is for the gnome-shell sources but I have some errors with files which don't exist.

If someone more experimented could make a PKGBUILD to include those patches, it would be very nice :D !

Edit : The 2 patches are actually for gnome 3.7, : the first one is for the gfs package, the second one for gnome-shell.

For gfs you can apply the patch, it is the same for gfs 3.6 and gfs 3.7.

For gnome-shell it's not so easy because some files do not exist on 3.6, and for the others they have been edited during the 3.7 development so you can not apply directly the patch, you have to patch sources manually. Jasper St. Pierre, the patches author, said that we have to add "cr.$dispose();" at the end of each function where the "cr" variable is declared.
He modified some other things but I do not know how to adapt it to 3.6.2, so I just "disposed" cr variables.

For me it doesn't fix completely the memory leak, but at least it reduces it, and maybe it is because I missed something during the "manual patching" that is necessary to fix entirely the bug.
If I have some free time I will create a clean patch for gnome 3.6.2 and upload it.

Edit n°2 :

I asked to the patch author if extension developers have to dispose the variable in their extension (because it is what does the patch, dispose the variable for each gnome-shell menu), and this is his answer :

"Jasper St. Pierre [gnome-shell developer] 2013-01-10 01:05:04 UTC

Extension developers may have to dispose, which is unfortunate, but this is
hopefully a temporary hack that will be fixed in future versions of
Comment by _kronak (weox.os) - Tuesday, 22 January 2013, 19:43 GMT
exactly same problem, with nvidia , open source driver !!
start with ~50mb , and go to ~700mb ( i restart it in there )...
Comment by Anthony Ruhier (Anthony25) - Tuesday, 22 January 2013, 20:21 GMT
Gnome devs know that it doesn't depend of the driver, in every case on every distrib there is this memory leak with Gnome-Shell 3.6.

This will be fixed cleanly in Gnome 3.8, for now it is just a hack.
Comment by Green (The_Green_Arrow) - Saturday, 27 April 2013, 07:09 GMT
Fixed after the upgrade to Gnome 3.8.
Comment by Florian Schweikert (kelvan) - Saturday, 27 April 2013, 18:05 GMT
Fixed in 3.8.1
But I noticed a huge leak, without doing anything special.
After a day uptime gnome-shell using 1.2G and my notebook starts swapping like hell.
Comment by gsc (xgdgsc) - Tuesday, 30 April 2013, 08:26 GMT
It still goes more than 400m after one day with 3.8.
Comment by Anthony Ruhier (Anthony25) - Sunday, 05 May 2013, 23:13 GMT
Do I request the bugreport closure ?