We’re also seeing memory leak warnings after updating to JUCE 8 in pretty much all our projects. This doesn’t happen with the latest JUCE 7 master branch.
I have been facing the same issue since the beta, but the JUCE team was not able to reproduce it.
I don’t know if this is related but I also get “MONZA” exceptions.
I have a feeling this is related to the GPU I use (an intel 14th gen iGPU).
Thanks for reporting. The issue should be resolved by this commit on the develop branch:
Please try updating to the develop branch and see whether the issue is fixed for you.
The original issue reported in this thread is MSVC leak checker output, so this warning won’t appear on macOS. I expect that the macOS warnings are different. Please could you provide the text of the warning you’re seeing, along with the steps you’re taking to produce the warning, including the problematic plugin format and host (if any).
Thanks @reuk for the fix for MSVC; I don’t see any memory leak warnings on Mac anymore either (may have been the result of other changes that we’ve made in the meantime).
I had the same issue on my Windows 11 machine after downloading JUCE 8. To see whether there might have been any hidden leaks in my code that went unnoticed in version 7, I had https://www.deleaker.com/ have a look at it. It found quite many leaky code passages, actually, but all in JUCE 8 code, not in mine. Out of curiousity, I then also ran it on JUCE 7 code and it also reported memory leaks – not as many as in version 8, although nothing was mentioned in the console output. Maybe you should run such a tool yourself…
Is this fix in the latest Juce 8.0.1 release? I updated to it and there’s still the memory leak when closing. I notice that whenever I resize the window the memory usage spikes ~100mb. I simply reverted to Juce 7 for now
A fix for the original issue was already posted above. If you’re still seeing leak reports, I suspect that these are new leaks with a different underlying cause.
Do you see the same problem in any of the JUCE demos? The OSCDemo uses DatagramSockets internally, and I don’t see any leaks in that program.
Please can you provide either:
a minimal program that demonstrates the leaks, or
instructions to trigger the leaks in one of the JUCE demo programs?
Another technique you could try to narrow down the cause of the problem is to use git bisect to locate the JUCE commit that introduced the leaks. This assumes that the leak you’re seeing is a new issue, and that your program does not leak when built against an older version of JUCE. If we know which change introduced the problem, then we may be able to find the cause by inspecting the diff.