Is there a way to have valgrind spit out a message everytime I allocate memory

75 Views Asked by At

I am working a on a large C project and just introduced what I believe is a memory leak of a sort. As I run the code my RAM gets eaten up very fast and then frees up when I exit my program. The thing is valgrind doesn't seem to think there is a memory leak and doesn't spit out any messages.

I am running it with

./valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./a.out 

My guess is that I am building up some large dynamic list and then freeing at the end, so valgrind doesn't detect it. Is there some way to have valgrind spit out a message every time a function dynamically allocates memory so I can see what function is being called that builds up the memory.

Or is there some other program that give me detailed memory data of what functions have dynamically allocated how much memory?

0

There are 0 best solutions below