I would like to know how each of the marked lines of code affect memory consumption. Given that my sprite sheet takes say 4MB in memory.
CCSpriteBatchNode *spritesBgNode; // Line 1
spritesBgNode = [CCSpriteBatchNode batchNodeWithFile:@"sprites.pvr.ccz"]; // Line 2
[self addChild:spritesBgNode]; // Line 3
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"sprites.plist"]; // Line 4
sprite1 = [CCSprite spriteWithSpriteFrameName:@"sprite1"]; // Line 5
[spritesBgNode addChild:sprite1]; // Line 6
[spritesBgNode addChild:sprite1]; // Line 7
[spritesBgNode addChild:sprite1]; // Line 8
[spritesBgNode removeChild:sprite1]; // Line 9
[spritesBgNode removeSpriteFramesFromFile:@"sprites.plist"]; // line 10
[self removeChild: spritesBgNode]; // Line 11
i) At which line(s) does the 4MB sprite sheet start consuming memory?
ii) Does Line 5 lead to any extra memory consumption?
iii) What happens in the case of Line 8 (Line 7 added again), how does it affect memory?
iv) How does Line 9 and Line 10 affect memory consumption? Do they free memory?
v) If the batch node will not be used for a while is Line 11 advisable? What are the implications of adding it again later.