Menu Share

Fixing memory leaks with Deleaker

by | Published on
category C / C++

Some time ago I wrote an article about memory leak detection on Windows. There I mentioned Deleaker as a premium option on profiling memory allocations and leak detection. In this article I will go more in depth on the features that this application has to offer.

Table of Contents

What is Deleaker?

Deleaker is a Windows application for detecting and fixing leaks and profiling memory allocations. The application itself can take the forms of a Visual Studio plugin, standalone appliation, and a plugin for other IDEs like Delphi, C++ Builder and Qt Creator. The application works both with managed .NET code and unmanaged code like C++. It can detect leaks with various Windows objects and handles. You can have resource usage graphs on your memory usage and comparisons between snapshots as well.

Why choose Deleaker?

Deleaker so far is the best memory leak detector that I have seen. It has several features that put it above other tools that do similar tasks:

  • Lightweight – The tool is fast to load and use and doesn’t affect the performance of the profiled application
  • Multiple Targets – Supports mutliple IDEs and compilers on Windows.
  • Accurate – Pinpoints the correct location of leaks quite accurately and allows for filtering to help in more complicated scenarios.

You can also use Deleaker as a standalone tool and in command line mode. This allows to integrate the tool with an existing continuous integration pipeline and report on newly introduced memory leaks.

Following on the Deleaker’s official blog You can find that the tool also supports detecting leaks in Java Native, MinGW, Clang and others. This is a major feature for me as you can test how would your applicaiton behave if compiled with Linux compilers and tools giving you an approximate fix for memory leaks even in cross-platform scenarios.

How to use it?

I mostly used the standalone version of Deleaker as I prefer the MinGW toolchain and CLion IDE on Windows instead of Visual Studio. You can get a demo version of deleaker from their website and also apply for a 14 day trial license for evaluation. After that you have to pay to be able to pinpoint memory leak stack traces as they are not included in the demo version.

In the standalone version you can start a debugging command by selecting the executable you want to run and the working directory and any arguments you want to pass in.

As you can see in the opened window we have run the application and after close it shows a sample memory leak. There is a stack trace and a locaiton that you can use to open up in your default editor of choice.

While the application is running you can laso take snapshots using the “Take snapshot” button to collect memory states and then compare what allocations have happened between different snapshots or analyze the current allocation state of the application.

Additionally you can filter on leak types and modules:

For all the features you can always go and read the official documentation.

How does it compare to other tools?

Here I will not refer to any particular performance comparisons but I will say that:

  • Deleaker provided more accurate information than MTuner
  • Is better than Visual Studio’s own tools and also works with other compilers
  • Is way better than Valgrind on Linux which is the standard tool that everyone knows

But you can also decide for yourself. Just watch how easy it is to use from the creator himself:

Conclusion

Deleaker is the best premium tool that I found to handle memory leaks like a breeze. It will simplify your day to day memory bug hunting and it 100% deserves its price. Speaking of which you can acquire a license on this page. I strongly suggest that any of you working with C/C++ consider this option for detecting leaky code.

Leave a comment

Your email address will not be published. Required fields are marked *