x


[iOS Memory Question] At ~35MB of memory on a heavily multitasked iPhone4/iPad we are getting suspend-crashes after lowmemory warnings. Is there anything we can do?

Hey Folks,

We have an iOS application that runs at ~35MB memory over its lifetime. We are getting crashes after 10 minutes or so of gameplay on an iPhone 4 and iPad that have many other applications in the background. Usually we get a LowMemory warning log (but sometimes not). This LowMemory log shows other programs being jettisoned. No other crash logs are generated. Generally our app appears to be suspended when this occurs, but attempting to un-suspend it causes it to reset.

Is there anything to be done about this (aside from using less memory)? We don't get any (!) crashes on our 3G - just on the iPhone 4 with heavy multitasking. Are we doing something that might cause iOS to be unable to terminate background apps, or that might cause us to suspend when this occurs?

Thanks!

more ▼

asked Jun 22 '11 at 10:06 PM

mjewkes gravatar image

mjewkes
1 3 3 3

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The first thing to do is hook in a send message for the low memory warnings so you can free up stuff as needed.

The other thing to do is look how much memory you really use. Don't forget, that you are using more than just the system RAM, because textures you loaded that are in VRAM use up RAM too as they are held in RAM, so its well possible to use 35mb of regular RAM and 100mb of VRAM which would be a lot.

And no you can't do anything to tell / prevent ios from kicking out background tasks, it will do it on its own as it sees need and it won't suspend the current active one. if you really get kicked out you either have a lot of background task enabled apps running (skype, audioplayer, gps programs and alike) or you really have masses of stuff in vram and bind just to much ram at the given time.

Are you sure you are not loading resolution / device dependent textures and audio and thus just hit the 3rd / 4th gen devices significantly harder than the 3G? like "decompress on load" audio with much more or larger audio on the new devices?

more ▼

answered Jun 23 '11 at 03:12 AM

Dreamora gravatar image

Dreamora
3.3k 1 4 25

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2026
x2013
x616
x366
x344

asked: Jun 22 '11 at 10:06 PM

Seen: 2357 times

Last Updated: Jun 23 '11 at 03:12 AM