0
votes

I have a Cocos2d game that contains a loading between 3 'worlds'. To do this the app uses:

[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:spriteSheetName];

To unload the previous 'world' in the loading I do:

[[CCSpriteFrameCache sharedSpriteFrameCache]removeSpriteFramesFromFile:plist];
NSString * textureFileName = [plist stringByDeletingPathExtension];
CCTexture2D *texture = [[CCTextureCache sharedTextureCache] textureForKey:[textureFileName stringByAppendingPathExtension:@"pvr.ccz"]];
[[CCTextureCache sharedTextureCache] removeTexture:texture];

When using dumpCachedTextureInfo I receive: CCTextureCache dumpDebugInfo: 36 textures, for 190476 KB (186.01 MB)

However Xcode memory tab shows around 600MB. I'm using an iPad 3 for testing. Finally after some memory warnings Xcode shows: 'Terminated due to Memory Pressure'.

Do anyone know why I have different memory values?

1
You could have a memory leak. Use Instruments to find leaks and run a "Analyzer" build which will point you to a number of potential (and real) issues.LearnCocos2D
@LearnCocos2D I already made both recommendations but I found no leaks. Thanks for the tips anyway.Jesod

1 Answers

0
votes

Make sure you are also releasing your touch delegate when you change scenes.