Reputation: 76
I work in a MnC software company. My task is to fix memory leaks in the software. I am using valgrind memcheck tool. I used 'valgrind --leak-check=yes --log-file=vg.log '. I found that valgrind is showing same memory leak multiples times in different sizes in vg.log and the vg.log file has 2 million lines. As a result I am not able to identify which leak has highest size. I mean which one is the biggest leak. Do you have any idea to solve this issue? I want same memory leak should come once in vg.log with aggregate size.I am using val3.12.0 version of valgrind. I am using Red Hat Enterprise Linux Workstation release 6.5.
Upvotes: 0
Views: 450
Reputation: 76
Actually valgrind has a --num-callers option which can used to club different similar memory leaks.
Upvotes: 0
Reputation: 6946
The leaks are dumped in order of increasing size. Therefore the last leak is the biggest one. Each leak description looks something like
XX bytes in B blocks are definitely lost in loss record R of N
where
Upvotes: 0