iOS Metal app encountering jetsam error

Hi,

Currently my app crashes when in the middle of loading a level due to hitting above 650 MB on iOS, according to the jetsam error log. It can be more or less reliably reproduced by cycling through several levels one after the other, about 4 times.

Logs show that the app crashes in the middle of loading shaders, with these lines:
LogMetal:Display: Loaded a non-offline compiled shader (will be slower to load)

What is odd is that the levels must be loaded after each other for the bug to occur. If the level itself is loaded after the intro level, it does not crash. If I turn off Metal, it also ceases to crash (or has a much higher ceiling of repetitive level loading that I have not reached in testing).

I have tried methods such as instituting a 100MB limited texture streaming pool, making the levels stream into a common ‘container’ level, and trying to make sure my UMG widgets are not the cause by storing them in GameInstance. The former only extends the number of cycles the level loading can go through before crashing, and the other two don’t seem to have any effect. Monitoring the app using Instruments-Allocations indicates that for All Heap & Anonymous VM, persistent bytes are only about 23.7 MB.

This amount is also inconsistent viz Jetsam’s logs. Monitoring using Allocations, All Heap & Anonymous VM indicates 18.96 MB persistent bytes, but the app crashes and Jetsam logs indicate 166402 rpages (650MB almost exactly), and it having been terminated for “per-process-limit”. The log does indicate a memory warning is received. Can UE4 react to this in any way?

Attached is the UE4 log:link text

Do metal shaders really take up so much memory? Is there any way to ensure that all assets and data from previous levels are cleared completely?

Hello thespeech,

Would you happen to have a test case for me to investigate on my end. I see what you are saying, but it is hard to determine what is going on unless I have the issue occur on my end.

More specifically, how are you calling your levels to load/unload?

Thank you,

Hi,

I’ll PM you a link once I re-verify that it’s occurring on this project.

Apparently I don’t have permission to PM, so I’m just going to post the link here:link text

It crashes after approximately 4-5 iterations of level loading, including returning to the main screen on iOS.

Hi, any update on this?

Most of my levels are being called through streaming/unstreaming.

Hey thespeech,

I need you to grant me access in order to test the issue.

Thanks,

H.

Hi, I have updated the access permissions. Thanks.

Hey thespeech,

So I was not able to reproduce the crash, even with the provided project/assets. I will say there are ways to discard unused material quality levels which might help reduce the overall memory issue and avoid the crash altogether. There are also optimizations like multithreading if your device supports that feature.

I would say be sure your iOS device is up to date and you have all the correct packaging settings applied. Aside from that, I am not sure we can fix the issue without a solid repro case. I am going to close and mark this post as resolved for now, but if you have further information regarding a way to reproduce the crash (device specs etc.) then we can continue our investigation.

Thank you,

H.