# Crash when restarting level out of memory

**URL:** <https://forums.unrealengine.com/t/crash-when-restarting-level-out-of-memory/2299691>\
**Category:** Platform & Builds\
**Tags:** memory-leak, memory-usage, memory-management, unreal-engine, memory, question\
**Created:** [January 23, 2025, 5:58pm UTC](https://forums.unrealengine.com/t/crash-when-restarting-level-out-of-memory/2299691 "2025-01-23T17:58:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndrewFord](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/andrewford/32/755855_2.png) [@AndrewFord](https://forums.unrealengine.com/u/AndrewFord)\
**Post date:** [January 23, 2025, 5:58pm UTC](https://forums.unrealengine.com/t/crash-when-restarting-level-out-of-memory/2299691/1 "2025-01-23T17:58:55Z")

</div>

Hello!  
My game has a memory overflow and crash every time I restart a level. When loading the level for the first time it consumes 6GB, if I try to load it again immediately, the memory goes to 8GB+. This happens on different projects. I understand that the engine does not unload memory before loading a new (or the same) level. How can this be fixed? I tried to make a custom openlevel function using an empty level, load it, call garbage collection, delay and load next level through it, but it doesn’t help much.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [January 23, 2025, 6:30pm UTC](https://forums.unrealengine.com/t/crash-when-restarting-level-out-of-memory/2299691/2 "2025-01-23T18:30:46Z")

</div>

I think if you try this in a packaged game, it should be ok. The editor just doesn’t’ have the same memory maintenance systems running.

---

<div class="post-metadata">

**Author:** ![AndrewFord](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/andrewford/32/755855_2.png) [@AndrewFord](https://forums.unrealengine.com/u/AndrewFord)\
**Post date:** [January 24, 2025, 11:48am UTC](https://forums.unrealengine.com/t/crash-when-restarting-level-out-of-memory/2299691/3 "2025-01-24T11:48:28Z")

</div>

Everything is just the opposite. In the editor everything is ok, there are no jumps with memory increase when restarting the level during testing. But in the build there is a memory overload and a crash when the level restarts.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [January 24, 2025, 12:03pm UTC](https://forums.unrealengine.com/t/crash-when-restarting-level-out-of-memory/2299691/4 "2025-01-24T12:03:57Z")

</div>

Ok, strange…

---

<div class="post-metadata">

**Author:** ![AndrewFord](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/andrewford/32/755855_2.png) [@AndrewFord](https://forums.unrealengine.com/u/AndrewFord)\
**Post date:** [January 25, 2025, 11:27am UTC](https://forums.unrealengine.com/t/crash-when-restarting-level-out-of-memory/2299691/5 "2025-01-25T11:27:34Z")

</div>

I am developing for consoles. This problem persists on Xbox, PS, Switch. Increasing the delay before openlevel when using transition empty level kinda helped.
