Memory leak with Gtk+-2.0
My C++ GUI application on Linux Fedora uses Gtk+-2.0 and Glade-2.0 and underlying libraries. One window is frequently created and destroyed, but the memory usage always goes up, never down. When the window is created and displayed, a large chunk of memory is allocated. When it is destroyed, not only does this memory seem not to be recovered, but a further small chunk of memory is allocated. Using refdbg, I can see that the numerous objects allocated for the window are destroyed when the window is destroyed, so why does the memory usage go up not down?
I think Gtk makes extensive use of realloc - could this be causing memory to become fragmented and result in more/bigger blocks of memory being allocated?
My Gtk reference mentions that Gtk does garbage collection "when it gets around to it" - is there a way to force garbage collection?
Thanks for any advice.
|