|
From: Nicholas N. <nj...@ca...> - 2003-10-10 15:00:20
|
On Fri, 10 Oct 2003, Russ Fink wrote: > I'm a semi-newbie to valgrind, and a positive newbie to the application I'm > debugging. I'm getting a message from Valgrind that I don't understand; can > you help me? > > I'm running with --leak-check=yes, --show-reachable=yes. Valgrind is > saying: > > ==5843== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) > ==5843== malloc/free: in use at exit: 3036062 bytes in 3230 blocks. > ==5843== malloc/free: 24202 allocs, 20972 frees, 9377725 bytes allocated. > ==5843== For counts of detected errors, rerun with: -v > ==5843== searching for pointers to 3230 not-freed blocks. > ==5843== checked 6748468 bytes. > ==5843== > ==5843== 0 bytes in 383 blocks are definitely lost in loss record 1 of 9 > ==5843== at 0x4002B905: malloc (vg_replace_malloc.c:153) > ==5843== by 0x80507F8: ... > > What does it mean, "0 bytes in 383 blocks are definitely lost?" > Semantically, if I lose zero bytes, then I'm not leaking. I don't believe > my logic, though - I believe a leak is taking place, but for some reason, > Valgrind is unable to quantify the amount being leaked. Could you be leaking zero-sized heap blocks? If you do leak a zero-sized block, you really are losing memory because every heap block has administration bytes at the start and end. N |