- Home /
Unity3D app crashes out after error "Warning -> ApplicationDidReceiveMemoryWarning'
Not sure what the cause of this is, I thought it might be memory running out but attempting to limit the amount of memory used hasn't helped at all, any ideas?
There is dedicated section on this issue in Unity $$anonymous$$anual troubleshooting page : http://docs.unity3d.com/Documentation/$$anonymous$$anual/TroubleShooting.html#iPhoneTroubleShooting . Also you could try Remote $$anonymous$$emory Profiler (part of Remote Profiler)
Answer by Dreamora · Apr 17, 2013 at 11:34 AM
Thats not a crash. When iOS sends you this warning 3 times in a row, then iOS will kill your application for using more memory than available. When you get that messages, you are meant to respond to it and clear up some memory.
As a rule of thumbs regarding the RAM + VRAM you can use at a time on the devices:
On 3GS, iPad1, iPod Touch 4 you have 100-120mb for RAM + VRAM.
On iPhone 4, iPhone 4S, iPhone 5, iPod Touch 4 and iPad 2 / 3 you have 250-300mb of RAM + VRAM
On the iPad 4 you have > 500mb of RAM normally.
How can I read and respond to it from Unity's scripts?
You need to pass it into Unity first through using UnitySend$$anonymous$$essage and define which gameobject and which scriptfunction on that object is meant to get the message. Unity does not expose the memory warning internally by default.
As for responding to it: unload stuff you don't need or never load that much that you get to see the message (device specific quality level or even distinct levels if you don't instantiate the scene content through resources at runtime)