Finding mem leaks with mtrace() on glibc-based systems
- From: Ole Aamot <oka ping uio no>
- To: gnome-hackers gnome org
- Subject: Finding mem leaks with mtrace() on glibc-based systems
- Date: 20 Mar 2001 16:56:55 +0100
The mtrace() call and respective utility in glibc seems to handy
for tracking leaks whenever GNU_SOURCE is defined.
Quick usage:
#include <mcheck.h> and then call mtrace() at the start of func()
and muntrace() before it returns.
Compile the program with -g for debugging, and set the environment
variable MALLOC_TRACE to a file to log mem allocation and freeing.
Once you have run your program, run mtrace <program> $MALLOC_TRACE
It isn't utilized in GNOME sources AFAIS, why not?
http://cvs.gnome.org/lxr/ident?i=mtrace
-- Ole
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]