UE 5.1 iOS Shipping Only Memory Leak

Hi fellow developers and awesome people at Epic,

I had quite a dev journey today discovering a crash and learned a lot during investigation. So, I’d make a post as well as report this bug.

Before all, I’m using UE 5.1 (source build) on Mac Ventura with Xcode 14.1. Also, I’m using iPhone 11 Pro Max/ iOS 16.1.1.

When I tested my game on my phone, I discovered a crash after 10-15 min of gameplay. I tried to extract crash logs, no luck. No assertion, no out-of-memory logs. I reproduced the issue while Console.app is streaming all the device outputs. Then, I discovered “per-process-limit” kill command issued. (Screenshot here) Strangely, this kill command leaves no out-of-memory crash logs, but the log message indicates that iOS wasn’t happy about my game’s memory usages (as shown in the screenshot).

Next, I tried to figure out profile memory. I added the launch “-trace=default,memory” option for standalone game via project settings to use the console command stat LLMFULL. But, I didn’t find anything wrong.

I wanted to check the same with iOS device but I couldn’t figure out how to launch the app with custom launch parameters (-trace=…) for iOS device after enabling console with four finger tap, which I didn’t know it existed via project settings.

Finally, I tried Instruments.app which came with Xcode installation. Then, I found this continuous memory footprint increase. (Screenshot here).

Marking generation shows some texture and buffer instances keep growing. (Screenshot here).

At this point, I realized that I was analyzing with Shipping build. I wanted to check how Development build would do. I found that Development build didn’t leak! (Screenshot here)


I’m guessing I can workaround the issue by using “Development” build for now. But, I would lose all the optimization via Shipping build… I hope this is fixed soon.

2 Likes

Did you ever find where the leak was coming from or how to fix it?

For 5.1 builds, no, I didn’t investigate further. But, for 5.3, I published couple iOS games without memory pressure warnings that can lead to crashes. So, I believe it’s been addressed. But, I don’t really have a clue about the root cause or how to fix it.

I am running into the same issue in Unreal 5.4 and 5.5 - I have two very simple maps with just a CameraActor and a single actor I can click to transition into the other map. Huge memory leak that never keeps growing until the app crashes. Any ideas anyone?