-1

I had a bunch of memory leaks in my code ,I fixed a few , valgrind now gives this, which different from what i had before

according to a stackoverflow post this is what I'm supposed to get if i don't have a memory leak :

HEAP SUMMARY:
    in use at exit: 0 bytes in 0 blocks
  total heap usage: 636 allocs, 636 frees, 25,393 bytes allocated

All heap blocks were freed -- no leaks are possible

ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

but I get this :

==19608== HEAP SUMMARY:
==19608==     in use at exit: 326,220 bytes in 2,863 blocks
==19608==   total heap usage: 82,856 allocs, 79,994 frees, 25,964,400 bytes allocated
==19608== 
==19608== LEAK SUMMARY:
==19608==    definitely lost: 0 bytes in 0 blocks
==19608==    indirectly lost: 0 bytes in 0 blocks
==19608==      possibly lost: 0 bytes in 0 blocks
==19608==    still reachable: 326,164 bytes in 2,861 blocks
==19608==         suppressed: 56 bytes in 2 blocks
==19608== Reachable blocks (those to which a pointer was found) are not shown.
==19608== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==19608== 
==19608== For lists of detected and suppressed errors, rerun with: -s
==19608== ERROR SUMMARY: 284 errors from 49 contexts (suppressed: 0 from 0)

What does this mean?

edit(Answer): What do the suppressed leaks mean in Valgrind?

CheeseMan69
  • 57
  • 1
  • 6
  • This reachable block should not be a problem:. https://stackoverflow.com/questions/3840582/still-reachable-leak-detected-by-valgrind However Error summary says you have 284 errors, I would look at those. – zpasztor Jan 07 '21 at 12:47

1 Answers1

0

A similar question has been asked before, refer to this link How do I use valgrind to find memory leaks?. And yes, judging by the outputted message, you have memory leaks in your program.

boyruaro
  • 40
  • 7
  • valgrind doesn't show anything about where the leak is , i'm doing ```valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes ./bin``` what flags to show where the leak is? – CheeseMan69 Jan 06 '21 at 08:27
  • @CheeseMan69 Did you read your output `==19608== Reachable blocks (those to which a pointer was found) are not shown. ==19608== To see them, rerun with: --leak-check=full --show-leak-kinds=all` Did you try this? – john Jan 06 '21 at 08:42
  • @john I am already doing that and the output is not very different from what is there in the post – CheeseMan69 Jan 06 '21 at 08:57
  • @CheeseMan69 What I would advise then is that you edit the question above with your latest output, and make it clear exactly what flags you are using to run valgrind and what (relavent) flags you are using to compile your code. – john Jan 06 '21 at 09:05