Dynamic Analysis

Valgrind Memcheck

Run with Valgrind Memcheck

On Linux and macOS platforms CLion integrates with Valgrind Memcheck to help you detect memory errors.

It lets you run targets with Valgrind Memcheck and then get the results in a special tab in the Run tool window. Users can run both regular targets and unit tests targets with Memcheck.

Valgrind is also available on Windows with WSL toolchain and in remote mode.

Google Sanitizers

Run with Google Sanitizers

To detect addressability issues, memory leaks, data races, and uninitialized memory issues on Linux and macOS, use Google Sanitizers integration in CLion.

In case you use Clang >= 3.8.0 or GCC >= 5.0.0, when you run/debug your application or unit tests with -fsanitize compilation flag, CLion visualizes the sanitizers output in a "Sanitizer" tab in the run tool window. It allows you to review the list of errors and their traces in the IDE, navigate to sources, preview the sources or inspect the frame information.

CPU profiler

CPU Profiler

CLion integrates with CPU Profiler on Linux (Perf) and macOS (DTrace). Profiling is also possible in remote mode and on WSL.

You can run the profiler right from the IDE and review the analysis results in a dedicated tool window (View | Tool Windows | CPU Profiler).

Use the flame chart, call tree and method lists to get a better overview of the possible performance issues in your code. Navigate to the source code to locate the issues in the code base.

Learn more

Code coverage

Code Coverage

If you’ve ever asked the question, “Was this statement executed during the configuration run?”, that means you are looking for Statements Coverage measuring for your code. CLion has it thanks to the integration with llvm-cov/gcov tools.

In addition to line coverage, CLion can also calculate Branch Coverage. This method takes into account all the branches of each control structure.

You can get it for unit tests run or a regular configuration run. The results are available in the Coverage tool window or via a color indication in the editor’s left gutter.

Learn more