Memory Spike + Crash During Level Transition

I am getting memory spikes when a player travels to another level (from main menu to a server map). The memory spike seems to crash on some PCs (particularly laptops), but doesn’t crash on higher end PCs (desktops). What happens is the following:

  • From main menu: memory consumption ~ 2.5 GB

  • During transition: memory spikes to ~ 10 GB

  • After level loads (for PCs where the crash doesn’t happen): memory consumption comes back to ~ 5.5 GB

The types of crashes I see in the callstack logs are:

LogThreadingWindows: Error: Runnable thread RHISubmissionThread crashed.
LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000088
LogWindows: Error: [Callstack] 0x00007ffaf2b71347 nvwgf2umx.dll!UnknownFunction
LogWindows: Error: [Callstack] 0x00007ff78b91f455 Shooter-Win64-Shipping.exe!FD3D12DynamicRHI::GenerateBarrierCommandListAndUpdateState()

or this:

LogWindows: Error: Fatal error!
LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000024f84984564
LogWindows: Error: [Callstack] 0x00007ff78ba7af3b Shooter-Win64-Shipping.exe!GPUMessage::FSystem::PollMessages()
LogWindows: Error: [Callstack] 0x00007ff78ba65273 Shooter-Win64-Shipping.exe!GPUMessage::FSystem::BeginMessageScope()

or this:

LogThreadingWindows: Error: Runnable thread Foreground Worker #0 crashed.
LogWindows: Error: === Critical error: ===
LogWindows: Error: Fatal error!
LogWindows: Error: Crash in runnable thread Foreground Worker 0xc000007b

Any ideas why this spike happens, and how to stop it?

Hello there @ackyshacky!

From the errors you are getting, and the sheer ammount of your spike, it sounds like your levels are being loaded at the same time, during the transition. It’s also possible that the garbage collector is not acting in time.

For starterts, I wold suggest adding an empty map, to be used as a transition level. This should result in the previous map being completely unloaded, then the engine moves to the next map. You can also add a manual override via blueprint, to activate GC before the new level starts loading.

For further reading, please check UE’s docs on the matter: