Re: [valgrind]: mem leaks

Paul Floyd <[email protected]>
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>
On 1/22/21 9:31 PM, Kunal Chauhan wrote:
> Hi Team,
>
> As on my linux  board ,one of process showing some run time memory 
> increase as seen by pmap command.
>
> So how valgrind can be useful to search such mem leaks in big code.
>
> Or is there is way to attached valgrind and see where and which 
> instruction actually causing issue


Hi

You can't 'attach' Valgrind to a running process.

What you need to do is to run the process under Valgrind. If the process 
normally runs to completion, you can just run it under Valgrind (by 
default, the memcheck tool will be used, add --leak-check=full and 
possibly --show-reachable=yes).

If the process is running aas a daemon, then your best bet is to run it 
under Valgrind and then attach gdb to it and use monitor commands to 
check for leaks. That is documented on the Valgrind web page, here 
https://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver-commandhandling 
.


A+

Paul



_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.