Unreal Engine Editor Memory Leaks In a Specific Condition

EpikGeymir
Fri, 20 Jan 2023 16:12:32 +0000
C++

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.

3 posts - 2 participants