Strange IOS memory problems

I have a game for iOS devices. A couple of days before I got a memory problem in different devices.

What I'm doing is: 1. Delete from a device my game. 2. "Product->Clean" it in xCode. 3. Run it on the device. 4. Look at the memory in Instruments (Activity monitor). 5. Take another device. 6. Repeat from the first step.

iPad 1 with iOS 4.3.1: Game works fine, 51 MB memory is used in the main menu, 105 MB in the first level. iPad 1 with iOS 5, iPod 4 with iOS 5: Game crashes, 77 MB in the main menu, 130+ MB in the first level.

Does anyone have the same problem? Is it because of newer iOS?

10/31/2011 Six hours of breakpoints and jumping between devices gives me this: in iOS 4.3.1 glTexSubImage2D function, wich can be found in the openGLES.framework, never allocates any memory.

The same function in iOS 5.0 calls

glTexSubImage_Exec ->

gleSynchronizeTextureLevelOnCurrentDevices ->

gfxUploadPluginTextureLevel ->

gfxAllocateTextureLevel ->

malloc

After all, I had different pixels parameter in glTexImage2D and glTexSubImage2D, what led to additional 30% memory for each of sprites. In 4.3.1 difference in the pixels parameter was ok, but in 5.0 it is not. I don't know if it's a bug or not. Thanks to all.

Upvotes: 1

Views: 912

Answers (1)

David Dunham
David Dunham

Reputation: 8329

You need to figure out where your memory is actually going. Instruments is a good start, but you probably want to take heapshots at various points and compare. (I assume you have already used the Leaks instrument to identify true leaks, not just memory bloat.)

Upvotes: 0

Related Questions