Hello !
I am using compiled ROOT and tried the following :
- To start an interactive session, create a tchain, add some root trees
I used valgrind to spot memory leaks and here is the result for an interactive session.
No problem I would say.
> valgrind --tool=memcheck --suppressions=$ROOTSYS/etc/valgrind-root.supp root -l
$ TChain *ch = new TChain("MyTree");
$ ch->Add("file-*.root");
[...]
==998== HEAP SUMMARY:
==998== in use at exit: 82 bytes in 1 blocks
==998== total heap usage: 3 allocs, 2 frees, 270 bytes allocated
==998==
==998== LEAK SUMMARY:
==998== definitely lost: 0 bytes in 0 blocks
==998== indirectly lost: 0 bytes in 0 blocks
==998== possibly lost: 0 bytes in 0 blocks
==998== still reachable: 82 bytes in 1 blocks
==998== suppressed: 0 bytes in 0 blocks
==998== Rerun with --leak-check=full to see details of leaked memory
==998==
==998== For counts of detected and suppressed errors, rerun with: -v
==998== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 6)
- On the other hand, I compiled a root code: “./myprog.C”
And I do the exact same (see attachment)
> valgrind --tool=memcheck --suppressions=$ROOTSYS/etc/valgrind-root.supp ./myprog
[...]
==21654== HEAP SUMMARY:
==21654== in use at exit: 8,305,499 bytes in 97,124 blocks
==21654== total heap usage: 3,656,106 allocs, 3,558,982 frees, 513,917,846 bytes allocated
==21654==
==21654== LEAK SUMMARY:
==21654== definitely lost: 102,240 bytes in 4,146 blocks
==21654== indirectly lost: 414 bytes in 19 blocks
==21654== possibly lost: 34 bytes in 1 blocks
==21654== still reachable: 5,951,155 bytes in 70,314 blocks
==21654== suppressed: 2,251,656 bytes in 22,644 blocks
==21654== Rerun with --leak-check=full to see details of leaked memory
==21654==
==21654== For counts of detected and suppressed errors, rerun with: -v
==21654== Use --track-origins=yes to see where uninitialised values come from
==21654== ERROR SUMMARY: 21 errors from 1 contexts (suppressed: 6457 from 127)
And here there are a lot of memory leaks . What did I forgot in my compiled code to get such huge memory leak ? (of course it’s increasing when I increase the amount of files !) I would expect ROOT to delete the resident memory.
Thank you and cheers,
myprog.C (391 Bytes)