Maximum RAM memory exceeded causes app to crash in iOS

Hello, I’m developing an app in which you have to download 40-60 photos, and that causes the app to die.

The “WARNING → applicationdidreceivememorywarning()” message appears in the XCode logs, and then the app dies.

To give some context on what the images are used for: I have those images Firebase Storage service, downloaded with UnityWebRequestTexture, and then assigning that Texture2D to a RawImage’s Texture. The images are photos, not “game textures”.

I have read about Texture compression, NPOT/POT things, etc. But can I do anything about Textures that are downloaded from the Internet? Or only with the ones that already exist in the project?

MUCH thanks!

Do what Casiell says, but you can also download the images (JPG is the smallest) from the server as a byte array (raw JPG data) and then create a Texture2D from the stored JPG data only when the image is on-screen. Use ImageConversion.LoadImage() to make the Texture2D when you need to display it. Don’t forget to null the RawImage texture property when the RawImage goes off-screen and also call Destroy on the Texture2D.