- Qt Creator Manual
- Using Valgrind Code Analysis Tools
- Qt Creator Manual 8.0.2

Checking Code Coverage ◦ Detecting Memory Leaks with Memcheck

# Using Valgrind Code Analysis Tools

Qt Creator integrates Valgrind code analysis tools for detecting memory leaks and profiling function execution. You must download and install them separately to use them from Qt Creator.

You can run the Valgrind tools either locally on the development host or remotely on another host. You can use them to analyze both applications for which you set up a project in Qt Creator and applications for which you do not have a project.

Valgrind tools are supported locally only on Linux and macOS. However, according to Valgrind.org, support on macOS 10.8 and 10.9 is experimental and mostly broken. You can run the tools on a remote Linux machine or device from any development host.

To run the Valgrind tools to analyze an application for which you have a project, open the project in Qt Creator and select the kit to run the project. The kit specifies whether the Valgrind tools are run locally or remotely.

For more information about analyzing applications for which you do not have a project, see Running Valgrind Tools on External Applications.

To set preferences for the Valgrind tools, select Edit > Preferences > Analyzer. You can override the general settings for each project in the Run Settings for the project.

The following sections describe how to use the Valgrind tools:

- Detecting Memory Leaks with Memcheck
- Profiling Function Execution

Checking Code Coverage ◦ Detecting Memory Leaks with Memcheck