|
From: Thanesh G. <tha...@gm...> - 2007-10-22 15:23:46
|
Hi there, I am trying to investigate a memory leak in a library loaded by postgres database process. How can I use valgrind to do this. Earlier, I was able to use Valgrind to find memory leaks in executables as below. But, now I need to use it with a loaded library. valgrind --tool=memcheck --leak-check=full --log-file="./log" ./test Thanks, -Thanesh |
|
From: Christoph B. <bar...@or...> - 2007-10-22 18:39:56
|
Am Montag, 22. Oktober 2007 schrieb Thanesh Gopal: > Hi there, > > I am trying to investigate a memory leak in a library loaded by postgres > database process. How can I use valgrind to do this. Earlier, I was > able to use Valgrind to find memory leaks in executables as below. But, > now I need to use it with a loaded library. > > valgrind --tool=memcheck --leak-check=full --log-file="./log" ./test You have to run the main executable with valgrind. The loaded library is then checked too. It is not possible to attach to a running process. If the communication between the library and the main application is not too deep you could create a dummy library that starts a new process and communicates the data by an appropriate channel. The new process can be run under valgrind. Christoph |