Unreal Engine Editor Memory Leaks In a Specific Condition

Hello there,
I’m using Unreal Engine 5.1 on Windows 10. I’m dynamically loading assets for my pawn from a datatable. This itself, doesn’t cause any memleaks. The specific issue happens when in the editor outliner window, pawn actor is selected and then details window is opened. This causes the editor to freeze almost immediately. And it starts to memleak absurdly. From starting value of 2gb memory usage it goes up by gigabytes in seconds, and it doesn’t stop leaking, until I kill it from the task manager.

Following is the causing code, Im just loading a mesh asset from a data table.

void AHGCharacter::OnRepLoadout()
{
  UDataTable* LDT = LoadoutDataTable.LoadSynchronous();
  FHGLoadoutData* LD = LDT->FindRow<FHGLoadoutData>(RowIndex, "");
  SMComp = GetMesh();
  SMComp->SetSkeletalMeshAsset(LD->TPMesh.LoadSynchronous());
  SMComp->SetupAttachment(RootComponent);
}

This is a function of my pawn class. LoadoutDataTable is just a:

UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "DataTable")
TSoftObjectPtr<UDataTable> LoadoutDataTable;

This issue doesn’t block me from developing my game, since there are no leaks in the game itself. But this really bugs me, because there is something serious going on, which I don’t know why and it can cause serious issues later.

1 Like

If its a on rep notify function then perhaps at the start of the game the function is not triggered? (Onreps only fire & replicate when there is a change in value).

Could the soft pointer be uninitialized (not have its asset loaded) when you click the actor in the editor causing some unforeseen problem?

It’s triggered, since if it weren’t, my pawn’s mesh asset wouldn’t be loaded.