|
From: Victor S. <vic...@in...> - 2006-10-02 15:15:46
|
Hi,
Since I used Valgrind long time to fix memory leaks, I would like to share
some tricks.
First, Valgrind options:
--show-reachable=yes
--log-file-exactly=program.log
--run-libc-freeres=yes
--leak-check=full
--verbose
If you use glib, set G_SLICE environment variable to "always-malloc":
export G_SLICE=always-malloc
The problem is that by default glib use slices for (single and double) lists
and hash tables. Valgrind just see one big memory slice: it isn't able to
give file name and line number of malloc().
Finally, you my Valpyk script may help :-) See my last email on the mailing
list or see:
http://software.inl.fr/trac/trac.cgi/wiki/Valpyk
Victor Stinner
http://www.inl.fr/
|