Monitoring memory leaks in UE4


Is there something similar to _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ) in UE4 api ? Basically in VS if this flag is added the debugger will monitor for memory leaks, and when you stop debugging it will spit out a bunch of “memory leak detected” messages. Does UE4 have a similar feature already, maybe via some logging flag ?

I guess I could add _CrtSetDbgFlag somewhere in the app, but if this already exists in UE4 I 'd rather not add unnecessary things in the code.


I’m not sure if there are debug flags like this in the engine, but have you tried using a third party tool?
I’m really fond of valgrind (, it let’s you track basically anything you want in regards to memory and threading, unfortunately it doesn’t work on windows.

I have tried dr memory on my windows machine and it was pretty good!

EDIT: Had a look at the docs and it seems like they don’t support 64bit… a pity. Might have to use another one for UE4 then. :frowning:

I also know a few people who have recommended purify:
Not sure if it’s good or not though.
EDIT: Been looking this up for fun, and it seems like it might not be the best for UE4 either.

I wonder if anyone here on the forum has any good recommendations for tools memory profiling tools for UE?
Would be interesting to hear what Epic uses :slight_smile:

Best regards,

Quite interested in this myself.

I would suggest to use 3rd party tools like Deleaker if you are from VC++ / Windows world, or Valgrind if you are from Linux world. Hope this helps.

Deleaker, have to check that one out then :smiley:

Although… after checking out the site I have the creeping suspicion that ArtemRazin is mostly trying to sell his product in the forum. I apologize if I’m mistaken!
And it of course doesn’t mean it’s not good.

However, it is quite expensive… :frowning:


DrMemory is good enough for my case. And also, you can run static analysis for C++ like cppcheck. Both of them are free and good enough for me to stop intermittent and random crashes in my software. They are hard to trace and reproduced as most of them are due to unreleased memory, out-of-bound memory write etc. And when it crashed, the debugger points to source code location which is perfectly fine.

Syed, they mentioned on their page that they did not support 64bit target processes. Is that old info perhaps?
If that is the case, then that’s good news indeed! :smiley:


Just mentioned my product because noticed that other products were recommended (if I’m breaking some rules let moderators remove my messages, that’s would be ok). In fact you can use it for free during trial period and in a lot of cases it’s enough to find a problem.

I am always happy to offer a discount so far… If project is open source I do issue a license for free. I am not a big company, I am a developer.

I am not sure that I will be able to monitor this thread, you’re welcome to drop me a mail to support (at) deleaker (dot) com if you want some more info!

Try to use this software
Intel inspector

Thanks for all the suggestions !