iPhone game turns off unexpectedly

Hi,

Lately I've come across a really strange behaviour in my game. I have been trying to debug it for a few days now but I still can solve this.

I'm using XCode 3.1.4 and publishing 2.2.1 build for compatibility reasons.

The problem is:

When I run the build on my iPod Touch 2nd gen 8gb (3.1.3), the game turns on and when it get to loading the main menu it just turns off, unexpectedly. Sometimes, it does load it and sometimes not. Same happens for loading my main scene( when I manage go get to that point).

I tried removing objects from my scenes, cutting down on side by removing audio, etc. Yet I still can not get to the cause. I also tried restarting my iPod touch but it doesn't seem to help either.

If someone had the same experience or know what the cause is, please let me know.

NOTE: everything works absolutely fine in the unity iPhone editor.

Your game is probably using too much RAM, if it goes over 25MB there's a chance that the device will simply stop the process depending on what other programs are running, which might explain the randomness of the cut outs. Other than compressing every sound file and texture you have you can also try not to maintain pointers to objects and store as few variables as possible.

Also removing debug symbols and using code stripping if you haven't already will help, removing unused libraries and frameworks will save you some memory.

If you're sure you're well under the safe memory limit then there might be exceptions in your game. The device doesn't handle exceptions so check through your code with a fine tooth comb.