Hello, i'trying to understund why running my app with
valgrind --tool=memcheck --leak-check=yes -v /my/app
valgrind --tool=memcheck --leak-check=yes -v /my/app
To copy to clipboard, switch view to plain text mode
i get a sort of memory leak
132 (4 direct, 128 indirect) bytes in 1 blocks are definitely lost in loss record 20 of 163
132 (4 direct, 128 indirect) bytes in 1 blocks are definitely lost in loss record 20 of 163
To copy to clipboard, switch view to plain text mode
up here it just a little piece ....
I'm using the "direct approach", what should i do to prevent it?
It looks like when i call a function into my class in this way
parent_object->myFunc()
parent_object->myFunc()
To copy to clipboard, switch view to plain text mode
i earn a leak....
----------------- edit -----------------
to be more accurate my leak summury:
==3325== LEAK SUMMARY:
==3325== definitely lost: 708 bytes in 77 blocks.
==3325== indirectly lost: 22729 bytes in 420 blocks.
==3325== possibly lost: 0 bytes in 0 blocks.
==3325== still reachable: 728510 bytes in 26553 blocks.
==3325== suppressed: 0 bytes in 0 blocks.
==3325== Reachable blocks (those to which a pointer was found) are not shown.
==3325== To see them, rerun with: --show-reachable=yes
--3325-- TT/TC: 0 tc sectors discarded.
--3325-- 180208 tt_fast misses.
--3325-- translate: new 89667 (1628736 -> 24489134; ratio 150:10)
--3325-- discard 190 (2620 -> 35740; ratio 136:10).
--3325-- chainings: 71514 chainings, 0 unchainings.
--3325-- dispatch: 98933412 jumps (bb entries); of them 16549827 (16%) unchained.
--3325-- 1979/607625 major/minor sched events.
--3325-- reg-alloc: 15989 t-req-spill, 4351425+95101 orig+spill uis,
--3325-- 484044 total-reg-rank
--3325-- sanity: 1980 cheap, 80 expensive checks.
--3325-- ccalls: 547959 C calls, 54% saves+restores avoided (1744510 bytes)
--3325-- 726410 args, avg 0.90 setup instrs each (138758 bytes)
--3325-- 0% clear the stack (1643130 bytes)
--3325-- 156831 retvals, 34% of reg-reg movs avoided (103722 bytes)
==3325== LEAK SUMMARY:
==3325== definitely lost: 708 bytes in 77 blocks.
==3325== indirectly lost: 22729 bytes in 420 blocks.
==3325== possibly lost: 0 bytes in 0 blocks.
==3325== still reachable: 728510 bytes in 26553 blocks.
==3325== suppressed: 0 bytes in 0 blocks.
==3325== Reachable blocks (those to which a pointer was found) are not shown.
==3325== To see them, rerun with: --show-reachable=yes
--3325-- TT/TC: 0 tc sectors discarded.
--3325-- 180208 tt_fast misses.
--3325-- translate: new 89667 (1628736 -> 24489134; ratio 150:10)
--3325-- discard 190 (2620 -> 35740; ratio 136:10).
--3325-- chainings: 71514 chainings, 0 unchainings.
--3325-- dispatch: 98933412 jumps (bb entries); of them 16549827 (16%) unchained.
--3325-- 1979/607625 major/minor sched events.
--3325-- reg-alloc: 15989 t-req-spill, 4351425+95101 orig+spill uis,
--3325-- 484044 total-reg-rank
--3325-- sanity: 1980 cheap, 80 expensive checks.
--3325-- ccalls: 547959 C calls, 54% saves+restores avoided (1744510 bytes)
--3325-- 726410 args, avg 0.90 setup instrs each (138758 bytes)
--3325-- 0% clear the stack (1643130 bytes)
--3325-- 156831 retvals, 34% of reg-reg movs avoided (103722 bytes)
To copy to clipboard, switch view to plain text mode
Bookmarks