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 679312 - Memory leak regression from 2.16.6 (g_idle_add() or queue_draw())
Memory leak regression from 2.16.6 (g_idle_add() or queue_draw())
Status: RESOLVED DUPLICATE of bug 685959
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.24.x
Other Windows
: Normal major
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-07-03 09:40 UTC by Gabriele Greco
Modified: 2012-10-17 08:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A minimal example that triggers the leak. (1.90 KB, application/octet-stream)
2012-07-03 09:40 UTC, Gabriele Greco
Details

Description Gabriele Greco 2012-07-03 09:40:36 UTC
Created attachment 217917 [details]
A minimal example that triggers the leak.

We have found a regression that block us to migrate our existing WIN32 GTK based apps from GTK 2.16.6 (gtk.org bundle 20100207) to GTK 2.24.10 (gtk.org bundle 20120208), it seems there is a memory leak in g_idle_add() use or something related to queue_draw(), anyway the attached code (that I think is correct) do not leak in linux (ubuntu 12.04, gtk 2.24.10) nor on win32 (GTK 2.16.6) while it leaks about 12kbyte/sec with GTK 2.24.10 on win32 (it can be easily observed with win32 task manager, the program will make your machine unusable after a few hours).

I can confirm the leak in windows XP and in windows 7, I've not tried with vista.

I've had confirmation also in the gtk-app-dev mailing list that I can use g_idle_add to notify when a new frame is available without freeing the source, that works in linux and in older WIN32 versions and it seems the way to go also in the g_idle_add() documentation that says:

If the function returns FALSE it is automatically removed from the list of event sources and will not be called again.

The (real) code is a video player with multiple realtime streams, this code use g_timeout_add() to simulate the 25fps of the video, I fill the drawing area with a simple red/blue pattern without thinking to much to endianness of the pixel components, but this is a sample, the code leaks on win32/2.24.10 also if I do not draw *ANYTHING* inside the GdkImage...
Comment 1 Luis Menina 2012-10-17 07:58:22 UTC
Other users have the same problem:
http://stackoverflow.com/questions/10837776/memory-leak-in-gtk-under-windows-7-in-gtk-widget-queue-draw
http://www.developpez.net/forums/d1270483/general-developpement/programmation-systeme/linux/gtk/gtkp/memory-leak-gtk/

The example code on http://pastebin.com/DY4WVvth is shorter that the one provided here and shows the problem. As there are several people complaining, I think the bug should be confirmed. Is there anyone maintaining GTK on Windows these days, since Tor stepped back?
Comment 2 Luis Menina 2012-10-17 08:11:34 UTC
Might also be the root cause there:
http://www.digipedia.pl/usenet/thread/1097/28214/
Comment 3 Luis Menina 2012-10-17 08:16:04 UTC
Seems it's a duplicate of bug 685959.

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