I have 100 textures, each sized ~100 kb, and I want to create a SKAction with animating these textures for 4 seconds with 25fps, and looping the action forever. I'm loading them from an atlas (or several, as Xcode warns me that it splits the atlas into 9).
The problem is the memory usage increases from 4 to 150 mb's when I run the action. Everything's normal in the first three steps. Total size of the assets is ~12 mb.
Can the multi-atlas usage (Xcode splitting them on compile time) can cause this problem?
// Load the frames to an array
NSArray *sTreesRightAnimationFrames = ITBLoadFramesFromAtlas(@"s01-trees-right", @"s01-trees-right-", 100);
// Create the action
SKAction *sTreesRightAction = [SKAction animateWithTextures:sTreesRightAnimationFrames timePerFrame:1.0f / 25.0f];
// Create the forever action
SKAction *sTreesRightForeverAction = [SKAction repeatActionForever:sTreesRightAction];
// Preload the textures and run the action
[SKTexture preloadTextures:sTreesLeftAnimationFrames withCompletionHandler:^{
[treesLeft runAction:sTreesLeftForeverAction];
}];