hi,
how to check memory leaks in a program using valgrind on lab machine?
I tried following command but its not working:
valgrind --leak-check=yes prog_name
Please help
Thanks,
anon10270
hi,
how to check memory leaks in a program using valgrind on lab machine?
I tried following command but its not working:
valgrind --leak-check=yes prog_name
Please help
Thanks,
anon10270
Anon10270,
Please elaborate when you say *not-working*. I guess in your case, valgrind is saying "Command/program not found". That is happening because you need to prefix <my prog> with a ./ to indicate that it is in the current directory, otherwise, valgrind will search in your path and crib in case it cannot locate <my prog>.
Thanks,
Anup
Sir,
When can we tell that a memory leak will occur?
thanks,
Anon10038,
The question is not clear. You can check in the valgrind log and search for *lost* and *invalid*.
Thanks,
Anup