Q:

Very long restore time on my App

I'm not sure what can be done about this. My app is an iPad app and I use about 300MB of ram. There are about 250MB of textures loaded for the game at any given time.
Here is the problem. When I sleep my iPad, if I sleep it for a few minutes and return to my game, it becomes playable again in seconds. If I leave my iPad sleeping after having played my game or while my game is still running for about 1 day then I go back, my game takes about 3.5 minutes to restore. It's not a bug, I've looked through the debugger many times and everything works as expected. iOS must be restoring the heap from somewhere which takes about 10 times longer than loading the game in from scratch.
My current solution is to forget about restoring and I intentionally crash my app so it restarts itself after it has been away which gets me to the same state about 10 times faster. But I don't like this solution.
Has anyone else experienced such issues? Are there api's I should be calling or something to lower the restore times after several hours of iPad sleeping?  Is this issue documented anywhere?

A:

My current solution is to forget about restoring and I intentionally
crash my app so it restarts itself after it has been away which gets
me to the same state about 10 times faster. But I don't like this
solution.

This is a guaranteed way to make sure that your app doesn't get approved for distribution on the App Store.  There's two solutions to this problem:
1) Redesign your game. There's various techniques to this, including:
Breaking down levels into smaller pieces, so each stage requires less assets to load.
Shrinking textures and assets. E.g., use 256x256 textures instead of 512x512.  One 512x512 texture takes up the space of four 256x256 textures.  Would you rather load four of your textures in a scene in a few seconds, or 1?
Compress your textures.  Compressed textures are smaller and quicker to load than their uncompressed bretheren.
Your application won't even run on an original iPad Mini, because of it's RAM - it has 512MB, and you're currently trying to use 300MB at any given time.
2) Disable your app from staying in the background.
Every time your app loses focus (besides lock screen being toggled), it'll force itself to be reloaded from scratch... much like you're already doing now with a forced crash. See:

If you never want your app to enter the background set the
UIApplicationExitsOnSuspend key in your application’s Info.plist file
to YES

How to exit app while enter background
Those are my suggestions, though in all honesty I'd do the first one if at all possible.  It's more work, but you'd be able to make a more courteous iOS application when it comes to memory management plus you'd be able to target more devices.

