I recently burned multiple days, as well as new investitures of software, tracking down a bug.
When building for iOS, there is a hard cap at 700mb of memory at runtime. If you exceed this, the app crashes.
This is a fact. When you hit 700mb, the app will exit.
If you are relying solely on Unity logs to tell you why the crash happened, you are out of luck.
I went so far as to clone the netcode for gameobjects git repo into my project to debug, because I thought maybe it was some serialization issue and it only happened when I added something to my data.
Nope.
For some reason, when building for iOS, Unity’s compression fails at runtime and iOS throws errors like this:
WARNING: RGBA Compressed ASTC8X8 sRGB format is not supported, decompressing texture
This happens for virtually every texture in the game. So if the texture compression goes away, the assumption is that your textures are going to literally blow up your heap.
And that’s what happens. You load a few things into memory, bam, your game crashes.
Unity should be up to date on the targets it supports and be able to tell you about these limitations, if not build defensive mechanisms in place to avoid the chance.
If I were building directly on a mac, I might have been able to see this in system logs. Since I was debugging an app locally but the app was built on a mac remotely, I didn’t have that option and had to rely on in-game logs alone until I purchased an asset that let me see iOS logs on windows.
So TL;DR-
iOS has a memory limit of 700mb and force quits your app when you hit it.
Unity should detect the memory it’s allocating and build in preventative measures or at least inform the user when they hit this.