Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

242
Visualizações
Valgrind does not show correct heap usage when run an app through shell script

I am using valgrind to check heap allocation of archive/compression tool p7zip (7zip on Windows) on Linux. I downloaded the code from here (https://sourceforge.net/projects/p7zip/files/p7zip/) and build it (make all_test) and then installed it (./install.sh).

After installation, a shell script named '7Za' is created at /usr/local/bin and its content reads as:

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

Also, on the specified path /usr/local/lib/p7zip/7za the executable of 7za is placed.

Now, if I run valgrind to test the memory usage of 7za (which basically runs the shell script) using this command then I get just 2KB of heap usage.

valgrind 7za x file.7z

Whereas, if I directly use the 7za binary then I get high memory usage around 1MB which also looks real one:

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

Similary, when I build the code, a bin directory is created there containing 7za executable. If I run it from there, then I again get high and correct memory usage.

I am trying to understand what is the difference in both approaches. Why using installed app (run through sheel script) does not give correct memory usage.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

valgrind is supposed to debug memory related problems for ELF 64-bit or ELF 32-bit exectuables. It can't be used with shell scripts. So you won't be able to debug your application using the shell script.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda