linux - Valgrind does not show correct heap usage when run an app through shell script -


i using valgrind check heap allocation of archive/compression tool p7zip (7zip on windows) on linux. downloaded code here (https://sourceforge.net/projects/p7zip/files/p7zip/) , build (make all_test) , installed (./install.sh).

after installation, shell script named '7za' created @ /usr/local/bin , content reads as:

#! /bin/sh "/usr/local/lib/p7zip/7za" "$@" 

also, on specified path /usr/local/lib/p7zip/7za executable of 7za placed.

now, if run valgrind test memory usage of 7za (which runs shell script) using command 2kb of heap usage.

valgrind 7za x file.7z 

whereas, if directly use 7za binary high memory usage around 1mb looks real one:

valgrind /usr/local/lib/p7zip/7za x /home/z/desktop/file.7z 

similary, when build code, bin directory created there containing 7za executable. if run there, again high , correct memory usage.

i trying understand difference in both approaches. why using installed app (run through sheel script) not give correct memory usage.

valgrind supposed debug memory related problems elf 64-bit or elf 32-bit exectuables. can't used shell scripts. won't able debug application using shell script.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -