canCrash=true;

ok so if you’ve done everything possible to make an iPhone game not crash, and it still crashes, what do you do to try and find the problem?

I can make this pretty picture, but it doesnt help me at all. It crashes at the end of this graph with memory error.

Also attached is the stats of the scene I’m trying to load in Unity too.
Thanks
AC

388509--13366--$screen_shot_2010_09_18_at_12451_am_986.jpg
388509--13367--$screen_shot_2010_09_18_at_12304_am_447.jpg

Im using this stuff that I found in the docs, I dont know what it does but its supposed to help. Is it likely to cause harm instead?

DontDestroyOnLoad(this);

function Start () {
    useGUILayout = false;
    
    var tmp = new System.Object[1024];
	// make allocations in smaller blocks to avoid them to be treated in a special way, which is designed for large blocks
        for (var i : int = 0; i < 1024; i++)
		tmp[i] = new byte[1024];
	// release reference
        tmp = null;


iPhoneKeyboard.autorotateToPortrait = false;
iPhoneKeyboard.autorotateToPortraitUpsideDown = false;
iPhoneKeyboard.autorotateToLandscapeRight = false;
}

Abd I’ve also got this in a couple of places because its supposed to help System.GC.Collect();

Can that go anywhere or does garbage only get collected on Tuesdays?

System.GC.Collect just forces a garbage collection to happen immediately instead of waiting for memory to run out. This is really only used to make the CPU spike associated with the collection happen at a predictable place rather than in mid-game. It shouldn’t have any effect on the amount of memory allocated.

Likewise, the allocation of all those blocks of bytes is simply to expand the size of the heap at a predictable point in the game to avoid pregnant pauses.

At what point does the game crash? Does it happen after a certain amount of time or does the user have to do something first? Does the editor freeze or does the whole Unity app quit?