I'm getting application did receive memory warning sometimes. Does it
mean that my app is really bad? or it's normal, any suggestions on how to manage memory
and cocos2d properly,especially cocos2d timers?
Your help is appreciated!
Thanks!
A fast, easy to use, free, and community supported 2D game engine
I'm getting application did receive memory warning sometimes. Does it
mean that my app is really bad? or it's normal, any suggestions on how to manage memory
and cocos2d properly,especially cocos2d timers?
Your help is appreciated!
Thanks!
Do you have some non-auto-release objects that are created in loops? Do you release them? If you're having that problem and the game still runs fine, my guess is unreleased objects. If it's on and off, maybe you just have too much stuff loaded in the memory at the same time.
To second what QcMat said, check first with Instruments if you have any leak. Getting the memory warning on a regular basis is not normal. Once you're sure you don't have leaks, and if you still get the warning, you should try to use less resources at the same time. The following resources are memory gluttons :
- big sized images (big in number of pixels)
- wav files
Possible solutions for big images :
- pack them into a sprite sheet and use AtlasSprites
- reduce their quality (32-bit png => 16-bit png or 4-bit pvr)
Possible solutions for uncompressed wav files :
- reduce quality (stereo => mono, 44 kHz => 22 kHz, 32 bit => 16 bit or 8 bit)
- convert to a compressed format (ima4)
Thanks for suggestions guys!
I tried it with instruments, I didn't see any leaks, but the allocated objects one was almost to the top.
I'm getting memory warning message about once in three runs.
You must log in to post.