Dear all,
When I run valgrind on a program that is linked against ROOT (even if we don’t use ROOT in it), the output is huge (38 MB in my latest test with helloworld).
I am wondering whether it is a bug or something I do wrong.
How to reproduce
On lxplus, I have the following PATHs :
[quote]-bash-4.1$ echo LD_LIBRARY_PATH
/afs/cern.ch/alice/library/afs_volumes/vol12/geant3/lib/tgt_linuxx8664gcc:/afs/cern.ch/alice/library/afs_volumes/vol12/AliRoot/lib/tgt_linuxx8664gcc:/afs/cern.ch/alice/library/afs_volumes/vol12/root/lib
-bash-4.1 echo $PATH
/afs/cern.ch/alice/library/afs_volumes/vol12/bin:/afs/cern.ch/alice/library/afs_volumes/vol12/local/bin:/afs/cern.ch/user/b/bvonhall/scripts:/afs/cern.ch/alice/library/afs_volumes/vol12/AliRoot/bin/tgt_linuxx8664gcc:/afs/cern.ch/alice/library/afs_volumes/vol12/root/bin:/usr/sue/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin[/quote]
Compile the attached program :
/usr/bin/c++ -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -O2 -g -o testval -rdynamic `root-config --libs` -lm -ldl -rdynamic -fPIC -Wall -Wextra -Wshadow -Wredundant-decls -rdynamic test_valgrind.cpp
Run valgrind :
valgrind --suppressions=$ROOTSYS/etc/valgrind-root.supp --tool=memcheck --log-file=valgrind-root.output --leak-check=yes --show-reachable=yes --num-callers=50 ./testval
Check the size :
-bash-4.1$ ll -h valgrind-root.output
-rw-------. 1 bvonhall z2 38M Jun 24 15:38 valgrind-root.output
It is 38 MB of “still reachable” stuff.
Now for the sake of it, recompile without ROOT, execute valgrind and check the size :
c++ -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -O2 -g -o testval -rdynamic -lm -ldl -rdynamic -fPIC -Wall -Wextra -Wshadow -Wredundant-decls -rdynamic test_valgrind.cpp
-bash-4.1$ valgrind --suppressions=$ROOTSYS/etc/valgrind-root.supp --tool=memcheck --log-file=valgrind-noroot.output --leak-check=yes --show-reachable=yes --num-callers=50 ./testval
-bash-4.1$ ll -h valgrind-noroot.output
-rw-------. 1 bvonhall z2 641 Jun 24 15:39 valgrind-noroot.output
Without ROOT the size is minimal as expected, there is no memory problem.
So… What am I doing wrong ?
It is really a problem because I can’t find the real memory issues in my program.
Thank you
Barth
test_valgrind.cpp (610 Bytes)