Severe UE5 Memory leak BP visual debugging

I tried merging the 5.2 fix and it still didn’t fix all the issues with circular references.

I’ve hacked it for my build:
KismetDebugUtilities.cpp top of ::FindOrMake

// wait to populate children until after inserting into VisitedNodes.
	// this way we will catch circular references
	TSharedPtr<FPropertyInstanceInfo> DebugInfo = MakeShared<FPropertyInstanceInfo>(PropertyInstance);

... new code here
	static const int MaxDepth = 10;
	if (VisitedNodes.Num() > MaxDepth)
	{
		return DebugInfo;
	}
... end new code

This just means you don’t see deep debug info in the debug info popup you get when hovering. It was traversing a huge reference stack before this hack which took 1 minute or so.

A better temporary solution is to limit the recursion - pass a depth variable into the function by reference to monitor the stack depth and limit by this.

1 Like