A building and run problem

I’m working on a iphone game. When I tried to use xCode to build and run, after the first game level was loaded (the game starts with a menu level, and this menu level was fine.), the device killed the application.
The xCode console said the status value: 101.
But when I run the game on the device without xCode, it works.
This puzzles me for days. Does anybody know what does the status value 101 mean, and how this happened.

101 means your app was terminated because it allocated too much memory.

Thanks for your reply.

I’m still working on this game. After hours testing, I can’t run the game on the device neither. I use the xCode Activity monitor, the game was allocated about 66m memory. I know this is huge for ipod.
But the next day, when I do the same thing, the game runs well with or without xCode on the device. The problem never occurs again.
And I only did one thing. I want to try a simple game scene to load. So I add a scene to the game, and build and run it. From then on, the game works very well. Even later I delete the scene I add before, it still works fine.

This is so weird. Though the game works well now. But I’m still worry about it. Do you know why.

After you deploy the game to the device, you should restart it. Depending on what was running before (including your game), and how close you are to the available memory threshold, the OS may kill your game if the garbage collector hasn’t had time to run and reclaim unused memory. This will explain the intermittent nature of the issue.

Overall, though, since it sounds like you are near the available memory threshold in general, you should go through and make sure that you are conserving memory everywhere where you can and move as far as away from that threshold as possible. You can’t precisely control the memory situation on the phone.

To reduce memory, take a look at the import settings on all your textures and make sure that they are as constrained in size as possible (will still looking acceptable) and compressed. Also take a look at your sound files and make sure that they consume the least amount of memory as possible. There are quite a few posts on the forum about sample rate and format that discuss this. Also, make sure you are only keeping things around in memory between scenes that are absolutely necessary.

Thanks