Re: checking for memory leaks in gtk
- From: "Harinandan S" <harinandans gmail com>
- To: "Michael Torrie" <torriem gmail com>, gtk-list gnome org
- Subject: Re: checking for memory leaks in gtk
- Date: Wed, 14 May 2008 11:47:03 +0530
I observed continuous accumulation of memory while running GTK over
DirectFB on MontaVista linux on TI Davinci. I also observed
significant memory accumulation while running GTK-win32 on Windows XP.
But to my surprise there is no accumulation of memory
on GTK-X window running on RHEL 4 on x86.
I ran the same application on all backends.
Has anyone observed this? On DirectFB backend i also note that
application is killed after creating and destroying windows many
I use GTK+ 2.12.2 and DirectFB 1.1.1
On Tue, May 13, 2008 at 8:12 PM, Michael Torrie <torriem gmail com> wrote:
> Harinandan S wrote:
> > I looked at memory usage using 'top' and 'free' while running the
> > application and found that memory kept on increasing without decreasing when
> > i destroyed a window and finally application was terminated by MVL.
> > Meanwhile 'valgrind' is not supported on arm-linux platform so i am not
> > able to get more details. I'll try to run it on a x86 linux PC with
> > valgrind.
> Neither top nor free is that useful in determining memory leaks. As
> Paul alluded to, calling free() on a block that was malloc()ed does not
> automatically return memory to the system. It merely frees it on the
> heap, which belongs to the application.
> The free command under linux can't really help here, since Linux always
> over commits memory and thus you should never have more than a small
> percentage of your RAM free.
> top can be somewhat useful, but only in certain cases. For example, if
> you take your main() function and put it in a loop and run it thousands
> of times, then top should report that the VSS (virtual memory) used by
> the process never grows beyond a certain bound.
] [Thread Prev