# Run Valgrind

Source: [https://docs.qualcomm.com/doc/80-88500-3/topic/100_Run_Valgrind.html](https://docs.qualcomm.com/doc/80-88500-3/topic/100_Run_Valgrind.html)

Use the following command to run Valgrind for a program.

    valgrind  <option flags>  --log-file=<log file name>  <executable>Copy to clipboard

Example:

    valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers
    =20 --track-fds=yes gst-launch-1.0 -e qtiqmmfsrc name=qmmf ! video/x-h264,format
    =NV12,width=1920,height=1080,framerate=30/1 ! filesink location="/data/vid.h264"Copy to clipboard

Sample output:

    ==5356== LEAK SUMMARY:
    ==5356==    definitely lost: 16,384 bytes in 1 blocks
    ==5356==    indirectly lost: 0 bytes in 0 blocks
    ==5356==      possibly lost: 6,286 bytes in 79 blocks
    ==5356==    still reachable: 1,720,821 bytes in 21,010 blocks
    ==5356==                       of which reachable via heuristic:
    ==5356==                         length64           : 120 bytes in 3 blocks
    ==5356==                         newarray           : 1,552 bytes in 17 blocks
    ==5356==                         multipleinheritance: 152 bytes in 1 blocks
    ==5356==         suppressed: 0 bytes in 0 blocks
    ==5356==
    ==5356== For counts of detected and suppressed errors, rerun with: -v
    ==5356== Use --track-origins=yes to see where uninitialised values come from
    ==5356== ERROR SUMMARY: 192 errors from 110 contexts (suppressed: 0 from 0)
    Copy to clipboard

Note: valgrind-3.15.0 version used for the examples.

**Parent Topic:** [Valgrind debugging procedures](https://docs.qualcomm.com/doc/80-88500-3/topic/99_Valgrind_debugging_procedures_.html)

Last Published: Sep 26, 2023

[Previous Topic
Valgrind debugging procedures](https://docs.qualcomm.com/bundle/publicresource/80-88500-3/topics/99_Valgrind_debugging_procedures_.md) [Next Topic
RAM dump to SD card](https://docs.qualcomm.com/bundle/publicresource/80-88500-3/topics/101_RAM_dump_to_SD_card.md)