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

  • Home
  • SEARCH
  • 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 7442461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:10:41+00:00 2026-05-29T11:10:41+00:00

I am developing an iPhone game with cocos2d-iphone. I am particularly interested in how

  • 0

I am developing an iPhone game with cocos2d-iphone.

I am particularly interested in how much memory is CCSpriteFrameCache “holding” at the moment. I am wondering – is there a way to know that? Without using any Xcode tools?

Perhaps there is a variable that will already let me know an estimate memory consumption value on my app?

  • 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-05-29T11:10:42+00:00Added an answer on May 29, 2026 at 11:10 am

    Actually if you are concerned about memory consumption of your textures, they are stored by CCTextureCache. There is a CCTextureCache (Debug) method called dumpCachedTextureInfo method in there. I have not tried it myself, but here :

    @implementation CCTextureCache (Debug)
    
    -(void) dumpCachedTextureInfo
    {
    NSUInteger count = 0;
    NSUInteger totalBytes = 0;
    for (NSString* texKey in textures_) {
        CCTexture2D* tex = [textures_ objectForKey:texKey];
        NSUInteger bpp = [tex bitsPerPixelForFormat];
        // Each texture takes up width * height * bytesPerPixel bytes.
        NSUInteger bytes = tex.pixelsWide * tex.pixelsHigh * bpp / 8;
        totalBytes += bytes;
        count++;
        CCLOG( @"cocos2d: \"%@\" rc=%lu id=%lu %lu x %lu @ %ld bpp => %lu KB",
              texKey,
              (long)[tex retainCount],
              (long)tex.name,
              (long)tex.pixelsWide,
              (long)tex.pixelsHigh,
              (long)bpp,
              (long)bytes / 1024 );
    }
    CCLOG( @"cocos2d: CCTextureCache dumpDebugInfo: %ld textures, for %lu KB (%.2f MB)", (long)count, (long)totalBytes / 1024, totalBytes / (1024.0f*1024.0f));
    }
    

    You want to calculate per texture the bit format, since it is possible to store different texture formats in the cache, depending on your current needs. It will give you (last line) the summary of contents, including total memory consumed.

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

Sidebar

Related Questions

I am developing a game with cocos2d-iphone and I am going to add in
I am developing a 2D iPhone game by using cocos2d. I need a countdown
I am developing a 2d game for iPhone by using cocos2d. I use many
I'm developing a game for the iPhone at the moment and I'd like to
I'm developing a game for iPhone using COCOS2D . In that, I need to
Background: I'm developing a game for the iPhone/iPad using cocos2d-iphone. Our engine provides the
Im developing an iPhone game, and I want to know how to draw vector
Im developing an iPhone game, and I want to know how to draw vector
I'm currently developing a game on iPhone using the Cocos2D API. It's going well.
I am interested in developing IPhone game and am confused whether to choose HTML5

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.