Reputation: 51
I've build an app in unity for both android and IOS, and android has been running perfectly fine for months now. But IOS devices crash on a ram overflow error (EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=1450 MB, unused=0x0) on Iphone 7).
I've since reduced all the texture sizes (some were like 8k so this was a significant reduction) and I also compressed all the audio files. This got it working locally, but I've been rejected from the app store for crashing their test device (an Ipad).
I've never had any issues with Android, even on older devices with the uncompressed textures and audio, so why do these issues occur on IOS devices with far less memory usage?
Upvotes: 1
Views: 4883
Reputation: 1
I was thinking the same thing, but if you look at the difference in RAM performance between Android and iPhone devices, you'll probably be convinced. Android devices generally have much more RAM.
Upvotes: 0
Reputation: 614
Compression works very differently on Android and iOS.
This is a common problem with iOS, i myself have battled with it for years.
Try the following:
In order for your images to be properly compressed on apple platforms, they must be power of 2. On android this is not the case.
Manage all your images and audio files with the unity addressable asset system and load them into memory when required instead of having them in memory all the time.
Use sprite atlases
Check your audio file import settings, this is a common gotcha.
You mentioned that some images used to be 8k! That's crazy big. Even 4K or 1080 is unnecessary in my opinion. Try setting the maximum size of each image down to very small and slowly increase until you are happy with the way it looks. I bet you will be very surprised by how small you can get away with.
Number 5 is your best bet and a very important thing to learn.
And so number 2 is important to know about. If it seems complicated and too much work, then make games with less assets in them, because memory management is inescapable in larger games.
Upvotes: 1