Bash script to build and install valgrind 3.9.0 with memory limits of 128GB, 256GB and 512GB on linux-x86_64

Valgrind must have fixed memory limits so that it can accurately track the memory allocations of the program under test. On 64 bit architectures it is limited to 64GB. This script will download, modify and build valgrind for larger memory configurations.

Here is an example of how you might download and use it to create a 128GB version.

Here is an example of how you might download and use it to create a 256GB version.

Here is a description of how you might use it on an example program.

Step 1. Compile and link the program

In this very simple example I am using debug compile flags with extensions that provide more information in valgrind. These compile flags must be used with a newer GNU compiler like 4.7.2. I am using 4.9.1 for this example.

Step 2. Run valgrind

This is how you might run valgrind. It includes a suppression file just to show how it works.

Enjoy!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.