Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Virtual memory leak when using UIImageView setAnimationImages?
I'm seeing massive virtual memory usage when using setAnimationImages on a UIImageView. My UIImageView is fullscreen (480x320, landscape mode), and I'm passing it an array of 480x320 PNGs to cycle through, in a simple animation. The app I'm writing is a simple game for kids where you tap the screen, a multi-frame animation plays and stops. It changes the image to the next animal, then you can tap the screen again for another animation. And so on. FWIW the animation is of an animal. I'm also playing sounds (like a moo, etc.).
Every time I run the animation, VM usage goes up by several megs. This would make sense given that I'm using big fullscreen images. But what doesn't make sense is that the virtual memory is never released, and pretty soon Springboard terminates my app (when I get a bit over 80 megs VM usage). Real memory used is about 6 megs, and does not seem to be increasing (no leaks reported by the Leaks tool, anyway). If I comment out the code in animateAnimal below, the VM growth goes away, so I believe that's where the issue is.
I'd love it if somebody could explain why VM usage is going up like this. Am I not releasing something? Is this just what happens when you use setAnimationImages??
And finally, in touchesBegan (where I trigger the animation based on the screen being touched). Note: I'm also firing off some other timers to do other stuff (like play a sound a few seconds later), hence the use of a timer.
So...I don't get it. It looks to me like I'm using UIImage imageWithContentsOfFile, which is supposed to not cache the image (previously I was using imageNamed, which I hear can gobble memory due to caching)...so I think I've got that covered. I'm releasing the animalFrames and animalString objects. The animal UIImageView is using 'nonatomic, assign' (rather than retain)...which frankly I don't understand, but would seem not to be retaining memory.