We dealt with an issue yesterday, where our main character sprite (which can hold a large memory footprint) would occasionally disappear on the iPad. We have a level based game, and in random instances where a level was newly loaded or refreshed, the main character (which is a sprite animation) would fail to appear.
This had our minds boggled, so we hooked the iPad up to a console so we could try to gain some hints into what was going on. Each time the character failed to appear, the app had received a low memory warning during the level creation process. So we turned on texture memory monitoring which showed a fairly consistent usage of around 59MB. Each time the sprite failed to appear, memory dropped to around 24MB. This suggests that when the app received a memory warning the sprite would be removed.
We have no code on our end which acts upon a memory warning in relation to loaded sprites. So we looked into the actions taken automatically. Any items not currently in a view will be automatically dropped from memory when a warning is received. However, as soon as the sprites are created during the level creation process, they are added to a display group and should not be removed.
The only thing we can think of is that between the time that the sprites are loaded, and the time they’re added to the display, the low memory warning can sometimes be generated due to a significant increase in memory usage, and sent to the app before the app has the chance to add the sprite to a view.
Does this seem conceivable? We may need some expert advice here, and would appreciate hearing from anyone who has seen similar happenings. [import]uid: 35618 topic_id: 21720 reply_id: 321720[/import]