How to Resolve Memory Leaks in Unreal Engine for Mobile Games?

Hi everyone,

I’m working on a mobile game using Unreal Engine, and I’ve been running into an issue with memory leaks. After playing the game for a few minutes, I notice that the memory usage keeps increasing, even though there doesn’t seem to be any reason for it. It doesn’t crash, but the game performance degrades significantly as the memory usage goes up, leading to a poor experience for the players.

I’ve already tried the following:

  • Using the Memory Profiler in Unreal to track memory usage, but I can’t pinpoint the exact cause.
  • Checking for any unused assets or objects that might be lingering in memory.
  • Trying garbage collection tuning settings, but the problem persists.

I’m hoping someone here has faced a similar issue or knows some common pitfalls when it comes to memory leaks in Unreal Engine, especially for mobile platforms.

  1. Are there any tools or techniques in Unreal Engine that I might have missed for tracking or preventing memory leaks?
  2. Could there be any specific settings or Unreal Engine mobile optimizations that I should adjust to prevent this?
  3. Have you faced this issue on mobile platforms before, and how did you resolve it?

Any insights would be greatly appreciated! Thanks in advance!

Hello there @Rodrigo_Carpente!

From your provided details, it seems you are on the right path. You are already working with Unreal Insights, and tracking memory. I would suggest using further functions from the suite, checking for garbage collection events, increasing cleanups, and reviewing object lifespans.

As for mobile specific methods, please make sure that texture streaming is enabled, and optimized for mobile.

memory leaks can be tough, especially on mobile. In addition to what you’ve tried, make sure to remove any unused event listeners, use smart pointers like TSharedPtr, and profile with stat memory for insights. Adjusting garbage collection frequency can help, and check for static variables that may retain objects. Testing on different devices can also reveal patterns, so explore Unreal’s mobile memory management docs for more tips.