Callstack not being captured when running a trace with memory profiling enabled

Hi Everyone,

I’m currently trying to figure out the workflow for debugging memory issues using Unreal Insights.

I created an Actor that leaks 512KB of memory each tick, so that I could reliably produce a memory leak that I could then track down using Unreal Insights, for the purpose of creating an internal guidebook for my colleagues.

I started by going through the workflow described in this video here, but have not been able to get the call stack to correctly appear in Unreal Insights.

After launching the editor with the “-trace=default,memory,metadata,assetmetadata” as arguments, I start the game and spawn an actor in the leve. I then set gc.ForceCollectGarbageEveryFrame 1, and start + stop a trace to file.

When analysing the trace using the memory leaks rule I can see the leaks, but they do not have an associated callstack - The “Function (Alloc)” column just shows “Empty Callstack”:

[Image Removed]

Here is the code for the memory leak:

[Image Removed]

I’m running an editor compiled from source, and the config is DebugGame. Also, the modules for UnrealEditor-Engine.dll are loaded, along with all the other UnrealEditor-XXX modules. Also I was able to reproduce the issue on a packaged build running on a console dev kit.

How can I get the callstack to show?

Thanks.

Steps to Reproduce

Hey James,

this is likely due to the fact that you are starting the trace later during the process instead of at startup.

Memory tracing needs to start during startup to correctly resolve callstacks and collect all allocations.

While trace has a built-in cache, if you start the trace later it is likely that the initial information about modules or callstacks is no longer cached and you end up with missing information in the trace file.

Could you try running the same trace with an additional -tracefile or -tracehost as Editor parameters?

This should start the trace during startup and correctly resolve the callstacks.

Kind Regards,

Sebastian

Can confirm that I was able to see full stack traces when launching with -tracehost.

Thanks for the assist!