|
From: Philippe W. <phi...@sk...> - 2013-08-21 10:37:53
|
On Wed, 2013-08-21 at 11:12 +0400, Dmitry Antipov wrote:
> I'm trying to use valgrind --tool=memcheck --trace-malloc=yes in attempt to
> find inefficient memory allocations and optimize them out. It would be nice
> to have an option to dump the backtrace for each malloc/realloc/free/etc.
> call as well. Is there such an option? If not, is it possible to implement
> something similar in the next version?
"inefficient memory allocation" : do you mean
inefficient in cpu because a lot of malloc/free are done but
memory usage is reasonable ?
or do you mean
inefficient because it uses a lot of memory ?
(in this case: is it a temporary peak memory usage ?
or is memory usage just growing/big ?)
In both cases, you should be able to find the problem without
backtraces :
If the problem is cpu usage due to many malloc/free, callgrind
should be able to point at the culprit(s).
If the problem is peak memory usage, then massif should be able
to point at the culprit(s).
If the problem is just big/growing memory usage, then massif
and/or memcheck should be able to point at the culprit(s).
Philippe
|