Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8230053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:00:26+00:00 2026-06-07T17:00:26+00:00

I have a problem with memory management in cocos2d project. For my app I

  • 0

I have a problem with memory management in cocos2d project. For my app I need to build all my animations before the interaction beginning. I have three animation.
Each one have like 20 png file with a resolution of 1300 x 1000 px and have a size of 200ko.

So in my initialization i just wrote :

self.animation = [CCAnimation animation];
[_animation setDelayPerUnit:0.04];
for(int i = 1; i <= 20; i++)
{
   [_animation addSpriteFrameWithFilename:[NSString stringWithFormat:@"image(%d)@2x.png",i]];
}
[[CCAnimationCache sharedAnimationCache] addAnimation:_animation name:@"animationWin"];

This kind of code is executed three times. If I run my app, it crashes directly. If i just pre-load 2 animations I have no crash.
If I set breakpoints inside my for loops I can see that it crashes inside it.

I don’t know how to solve this problem … do you have an idea ?

Thanks a lot for your help !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:00:27+00:00Added an answer on June 7, 2026 at 5:00 pm

    Each one have like 20 png file with a resolution of 1300 x 1000 px and
    have a size of 200ko.

    Let’s do some math, shall we?

    Under the assumption that the PNG files are 32-bit and you do not have NPOT (non-power-of-two) support enabled, each texture consumes:

    1300×1000 => expanded to power of two => 2048×1024 => number of pixels => 2,097,152 => times 32-Bit (4 Bytes) color depth per pixel => 8 Megabytes => times 20 textures => tadaaa … a whopping 160 MB texture memory usage.

    Well there’s your problem!

    The file size of the PNG doesn’t matter. It’s a compressed format. But textures are uncompressed, unless you switch to PVR which are really well compressed but you also get artifacts and discoloration.

    Definitely best solution is to tune down the size and/or amount of artwork you’re trying to load.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem with memory management in my iOS App. I load
I have a Problem in my App with the Dirty Memory Size and want
I have a problem regarding the memory management when adding objects to a NSMutableArray
I have a problem with memory management. A have a scrollview and every page
I have a little problem with memory management in a Windows Service written in
first, i followed this tutorial: three20 github tutorial i have a memory management problem
I have a problem regards the memory management of my game on Android 2.2.
I have a memory management problem I can't get my head around on iOS.
I have this huge problem with memory management. The problem : I've got a
I have problem with the way I treat the memory management in iphone..please please

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.