After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683246 - Memory Leak in GtkSpinner
Memory Leak in GtkSpinner
Status: RESOLVED DUPLICATE of bug 685959
Product: gtk+
Classification: Platform
Component: Backend: Win32
Other Windows
: Normal major
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
: 684843 (view as bug list)
Depends on:
Reported: 2012-09-03 06:56 UTC by Philip Starkey
Modified: 2015-06-13 17:44 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Philip Starkey 2012-09-03 06:56:54 UTC
GTK Spinners leak memory when spinning and visible. If you hide the widget, or stop it spinning, the memory usage does not go up, but it does not reset either. Memory usage will continue to climb once you start it visibly spinning again. It also leaks when behind another window (for instance a terminal).

Minimalistic example:
import gtk
window = gtk.Window()
spinner = gtk.Spinner()

Run the example and watch the python process memory usage climb up by a few Kb per second. It isn't a very quick leak, but anything that relies on GTK Spinners will crash after several days once the memory usage gets too high. One example (of many) is Glade, with a visible spinner, left open over a weekend, will result in a crash by the time you come in on Monday morning. 

This bug makes it difficult to have long running, robust programs.
Comment 1 André Klapper 2012-09-26 07:54:52 UTC
*** Bug 684843 has been marked as a duplicate of this bug. ***
Comment 2 Emmanuele Bassi (:ebassi) 2012-09-26 08:34:00 UTC
it would be nice if you could run your example under Valgrind to detect the leak; you can follow the instructions here:
Comment 3 Philip Starkey 2012-09-27 00:34:16 UTC
Hi Emmanuele,

I might be missing something, but Valgrind appears to only run under linux and OSX.

This is a bug that exists on windows only, I've tested under linux and spinners do not leak there.

Comment 4 Philip Starkey 2012-09-27 02:09:52 UTC
Further to the comment posted by Andre in the duplicate bug, it cannot be tested with PyGObject since PyGObject doesn't work on windows as far as I know (this makes me wonder why PyGTK is considered deprecated, but anyway...). 

Since the bug also exists in Glade, it is clearly a gtk+ bug, not a pygtk bug anyway. Apologies for selecting the wrong category. I'm going to attempt to change the product category for this bug to gtk+.
Comment 5 Luis Menina 2012-10-24 09:24:02 UTC
Currently, GTK widgets on Windows leaks on every redraw (see bug 685959), so as the spinner triggers some redraws for its animation, it's a possible duplicate. Would it be possible for you to test if the patch provided there would fix your problem?
Comment 6 William Jon McCann 2014-02-21 21:13:24 UTC
For what it is worth I don't see any problem with the X backend. Does this still occur for you now that bug 685959 is fixed?
Comment 7 Philip Starkey 2014-02-24 06:45:54 UTC
As i'm a PyGTK user, it is a bit difficult for me to test. I'd have to get the latest gtk+ development source (since no release with this fix has been made) and then attempt to compile pygtk with it. I could probably work out how to do this eventually, but can't really dedicate the time to learn. It would be far simpler if you could find someone who programs in gtk+ directly to test (which is probably what you are after anyway)
Comment 8 Alexandre Franke 2015-06-13 17:44:48 UTC
Thanks for taking the time to report this.
Closing as duplicate of 685959. Feel free to reopen if you find out that it's actually a different issue.

*** This bug has been marked as a duplicate of bug 685959 ***