From: Tom H. <to...@co...> - 2006-11-29 08:47:15
|
In message <759...@ta...> raj...@ya... wrote: > I need to know how can i detect memory leaks in a shared library using > valgrind.Is any body knows how to do this.Thnks Well the obvious answer is to just run valgrind in the normal way and it will happily tell you about memory leaks in shared libraries just as it will about memory leaks in the main executable. I suspect you actually mean in a dynamically loaded shared library though - ie a plugin type situation? It should find those leaks as well, it just won't be able to give you very useful information about where the memory was allocated if it was allocated from inside a shared library. Ways around that include modifying your program to not actually call dlclose on the libraries and using LD_PRELOAD to force load them so that they don't go away when dlclose is called. Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |