I am using Cocos2d 2.0 with ARC enabled. My game is a random generated game so I need to load/unload textures( spritesheet-batchnode) within a scene in the middle of the game. I am trying to removespriteframesfromfile and remove texture for key for a spritesheet that i wish to unload in the middle. When I use dumpcachedtextureInfo after unloading the sheet, that spritesheet texture doesnot show up in the logs of dumpcachedtextureinfo.
But when I use Instruments/activity monitor to profile my app, the real memory usage doesnot drop after unloading the texture and spritesheet.
Is there a way where dumpcachedtextureinfo will not show a texture that is still in memory? Also, My livebytes column in allocations shows 4 MB.
Also as i read at various places that allocations doesnot show texture memory.
So my allocations live bytes column says 4 MB, my total texture memory as shown with logs of dumpcchedtextureinfo is shown to be 84MB, but memory monitor stills shows real memory usage to be 84+Spritesheet size+ Live Bytes
I am not able to understand this difference?
I am not exiting the scene, so I am not sure if ARC is holding the memory or what?
Some useful notes for you
This Cocos2d memory optimisation explains very well about memory management in Cocos2d.
To check total memory allocation use: Instrument->Activity monitor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With