Re: Memory Leak Tool with GLib Applications



On Tue, 2003-10-21 at 04:07, Tony Cheung wrote:
Hi,

I am using glib as a foundation library for some C application developments.

I have been using mpatrol, as a memory leakage detection tool. However, 
when I use mpatrol with glib applications, it reports some false memory 
leaks. Does anyone have any experience of using mpatrol with glib 
applications?

It seems that glib allocates some blocks of memory and keep reusing 
them. When the application quits, it relies on the OS itself to free the 
memory.

[...]

Is any way to use mpatrol with glib applications? Or is there any other 
memory leakage tool which works with glib nicely?

http://people.redhat.com/otaylor/memprof/memtools.html

Of the tools listed there, Memprof, Valgrind, Debauch, and the Boehm
GC are all smart enough to detect when memory is *actually* leaked.

I'd recommend either Memprof (simple, to the point, pretty easy
to use GUI, but badly maintained) or Valgrind (all sorts of power,
well maintained, but more complex) if you are running on Linux.
On other operating systems, the Boehm GC would be your best bet.

Does glib provide some destruction functions for cleaning up those 
unused memory blocks when application quits?

No. (http://bugzilla.gnome.org/show_bug.cgi?id=64096 is a request
for such, but it is unlikely to happen any time soon)

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]