zmalloc - How to measure Valgrind's memory usage? -


i have application written in c uses zmalloc (borrowed redis) memory wrapper keep track of total dynamic allocated memory program. using valgrind on linux find memory leaks , invalid memory accesses.

the problem zmalloc , top show totally different memory usage reports when using valgrind. makes me think valgrind consuming memory.

how measure valgrind's memory usage?

valgrind tools such memcheck or helgrind use lot of memory tracking various aspects of program. so, normal top shows lot more memory program allocates itself.

if want have idea memory used valgrind, can do:

valgrind --stats=yes ... 

the lines following

------ valgrind's internal memory use stats follow ------

will give info valgrind memory usage.

use valgrind --profile-heap=yes ... have detailed memory use.

note if not use standard malloc library, might need use option --soname-synonyms=... have tools such memcheck or helgrind working properly.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -