Re: checking for memory leaks in gtk
- From: "Harinandan S" <harinandans gmail com>
- To: iborco gmail com
- Cc: gtk-list gnome org
- Subject: Re: checking for memory leaks in gtk
- Date: Wed, 7 May 2008 19:53:46 +0530
Hi All,
I have observed memory leak in GTK+ too. I have multiple windows created when some buttons are pressed and destroyed later. I observed that when i destroy a window memory allocated to it during its creation is not freed and memory consumed accumulates and application is killed by OS after a few window create and destroy cycles.
I am using GTK+ 2.12.2 with MontaVista linux on TI DM6446 platform.
Does anyone know why gtk_widget_destroy is not freeing memory?
Regards,
Harinandan
On Fri, May 2, 2008 at 7:45 PM, Ionutz Borcoman <
iborco gmail com> wrote:
On Friday 02 May 2008 2:18:04 pm Ovidiu Gheorghies wrote:
> Hi,
>
> Could you post the full output of the following (use the -g flag when
> compiling):
>
> export MALLOC_TRACE=0.mtrace.log
> export G_SLICE=always-malloc
> export G_DEBUG=gc-friendly
>
> gcc -g [more-compilation-options] helloworld.c -o helloworld
>
> valgrind --tool=memcheck --leak-check=full ./helloworld
>
> mtrace ./helloworld $MALLOC_TRACE
The last command will report "No memory leaks". But it is a bogus and useless
result.
I've added an explicit leak in the program and that last command still
reports "No memory leaks", even though valgrind sees the increase in leaked
memory.
This is probably due to the fact that valgrind replaces the calls to malloc,
realloc and free while mtrace counts the leaks produced by these functions
(that are no longer used when run under valgrind).
So, till I get some better solution, I'll stick with the valgrind suppression
files.
Cheers,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]