Valgrind is an instrumentation framework for building dynamic analysis tools. There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. You can also use Valgrind to build new tools.
See http://valgrind.org/ for more info.
Built from https://github.com/sailfishos/valgrind
Example usage from https://stackoverflow.com/a/44989219
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=log.txt harbour-app