Problems running my game on an iOS device...

I am encountering the following error when I try to run one of my game’s scenes on an actual device (it works fine in Unity and in the apple iOS simulator). I cannot think of anything in this scene that is memory intensive (in fact, this problem only started recently, the scene used to run fine). I know this is not much info, but I do not know what is wrong. Are there any common reasons for getting this memory error? Thanks

> 2012-08-31 18:39:00.137
> gradius[195:307] Received memory
> warning. Level=1 WARNING ->
> applicationDidReceiveMemoryWarning()

iOS will monitor your app’s memory usage and warn you when your app is using a disproportionate or “large” amount of memory. I think “large” is rather subjective because it depends on the total amount of RAM in the device (which varies quite a bit between devices) and the amount of RAM being used by other applications.

When iOS sends these warnings to an app, the app is supposed to respond by reducing it’s memory usage. Unity, however, doesn’t pass this message to you, so you can’t exactly react to it. The idea is that you get a couple warnings about your memory usage, and then iOS kills your app (a crash) to avoid a memory crisis.

These memory warnings are undesirable, but they aren’t exactly the end of the world. Some stuff I’ve worked on gets these quite a bit (especially on iPad 1), and actually experiencing a crash is still pretty unusual. I would try to gauge how much these warnings are reflected in the gameplay experience.

If you’d like to monitor your memory usage while running the game, you can use XCode’s Instruments tool to see how much memory you are using and get a sense of when/why your memory increases. Memory could be eaten up by assets in your game, but it can also be caused by creating a really large array in code or by having a memory leak.