# Has anyone tried Deleaker with their JUCE projects and how is it?

**URL:** <https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346>\
**Category:** Windows\
**Created:** [February 9, 2021, 2:53pm UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346 "2021-02-09T14:53:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephenk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stephenk/32/15198_2.png) [@stephenk](https://forum.juce.com/u/stephenk)\
**Post date:** [February 9, 2021, 2:53pm UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346/1 "2021-02-09T14:53:12Z")

</div>

Has anyone tried Deleaker with their JUCE projects (and Visual Studio 2019) - and how is it?

[https://www.deleaker.com/](https://www.deleaker.com/)

---

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [February 9, 2021, 8:26pm UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346/2 "2021-02-09T20:26:25Z")

</div>

Completely unnecessary.

---

<div class="post-metadata">

**Author:** ![stephenk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stephenk/32/15198_2.png) [@stephenk](https://forum.juce.com/u/stephenk)\
**Post date:** [February 9, 2021, 9:46pm UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346/3 "2021-02-09T21:46:13Z")

</div>

Would you care to elaborate? that’s not very specific…

I’m currently using Virtual Lead Detector with VS2019, and every now and then it prints something like:

“VLD: New allocation at already allocated address: 0x000002220AF203F0 with size: 84 and new size: 84”.

I didn’t use to see this; it seems recent. This worries me, and I cannot get any more info about it. I was wondering if Deleaker might be of use…

---

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [February 9, 2021, 10:05pm UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346/4 "2021-02-09T22:05:52Z")

</div>

JUCE already has its own leak detection for JUCE related objects. You can easily use the same macros as them to force leak detection on your own objects too.

System-specific leaks (GDI etc.) are not really your concern as they are abstracted away from you in JUCE and as such are a JUCE problem.

It seems to me you are looking for problems. Do you have unexplained crashes? Do you actually have a leak? Is your plugin or program leaking memory?

---

<div class="post-metadata">

**Author:** ![stephenk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stephenk/32/15198_2.png) [@stephenk](https://forum.juce.com/u/stephenk)\
**Post date:** [February 9, 2021, 11:32pm UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346/5 "2021-02-09T23:32:20Z")

</div>

You actually find JUCE leak detection adequate? Have you ever used something that provides more detail, like Visual Leak Detector? I like to be told exactly where in the code the leak is coming from; not that “some class” was leaked. It’s better than nothing, but hardly great.

I work mainly on the Mac; then move over to Windows every now and then to check what I’ve done. No, not having crashes; however when I start seeing messages on a new compile that I have not seen previously, it’s a source of concern. I’ve tried to narrow it down to changes made since the last time I ran it on Windows, but not having any luck. Anyway, have you actually tried the Deleaker program?

---

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [February 10, 2021, 12:37am UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346/6 "2021-02-10T00:37:16Z")

</div>

> **[Find memory leaks with the CRT Library - Visual Studio](https://docs.microsoft.com/en-us/visualstudio/debugger/finding-memory-leaks-using-the-crt-library?view=vs-2019)**
>
> Learn how the C/C++ debugger and C Run-time Library (CRT) can help find memory leaks. The techniques include memory-leak reports and comparing memory snapshots.

---

<div class="post-metadata">

**Author:** ![stephenk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stephenk/32/15198_2.png) [@stephenk](https://forum.juce.com/u/stephenk)\
**Post date:** [February 10, 2021, 1:05am UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346/7 "2021-02-10T01:05:02Z")

</div>

Thanks. But have you ever used the Deleaker program? if not, how do you know it does not add something useful?

---

<div class="post-metadata">

**Author:** ![stephenk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stephenk/32/15198_2.png) [@stephenk](https://forum.juce.com/u/stephenk)\
**Post date:** [February 10, 2021, 2:13am UTC](https://forum.juce.com/t/has-anyone-tried-deleaker-with-their-juce-projects-and-how-is-it/44346/8 "2021-02-10T02:13:00Z")

</div>

Incidentally, I have tried the Microsoft CRT library you linked to. I am unable to get any line numbers when posting memory leaks. Just useless dumps.

I put this at the top of my PluginProcessor.h file:

```auto
#include "JuceHeader.h"

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

```

I put this in my PluginProcessor constructor:

```auto
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );

```

I purposely do not free some objects, and upon exit of the AudioPluginHost, where I am debugging it as an attached process, it prints out:

```auto
Detected memory leaks!
Dumping objects ->
{54664} normal block at 0x000001F80F17B0E0, 64 bytes long.
 Data: < > 00 00 00 00 CD CD CD CD F8 CF 16 0F F8 01 00 00 
{54663} normal block at 0x000001F80F17A8E0, 64 bytes long.
 Data: < > 00 00 00 00 CD CD CD CD 20 CF 16 0F F8 01 00 00 

[...] etc.

```

No line numbers or any helpful information. I seem to recall that you cannot use this in JUCE because of issues like:

> [@Conflict with \_CRTDBG\_MAP\_ALLOC (Visual Studio)](https://forum.juce.com/t/conflict-with--crtdbg-map-alloc-visual-studio/6040):
>
> I tried to include the Juce header in one of my projects, but I’m getting caught up on juce\_HeapBlock.h. The problem is that I define \_CRTDBG\_MAP\_ALLOC, which turns malloc() into a macro, causing juce\_HeapBlock.h to produce compile errors. I could turn off this #define but then I would lose standard-library level leak checking for a lot of existing code that uses malloc(). I don’t really see a way around it other than renaming the methods in juce::HeapBlock to not conflict with standard C libra…
