cocos2dx 游戏内存使用信息分析


  1.  
    1. auto ss= Director::getInstance()->getTextureCache()->getCachedTextureInfo();  
    2.    log("%s",ss.c_str());  

     

    "/Users/yannei/Library/Application Support/iPhone Simulator/7.1/Applications/1FB2A229-F755-4E39-887D-3057C3A692EC/baoweiluobo iOS.app/Pets/PetsTheme06-hd.png" rc=51 id=8 861 x 248 @ 32 bpp => 834 KB

    "/Users/yannei/Library/Application Support/iPhone Simulator/7.1/Applications/1FB2A229-F755-4E39-887D-3057C3A692EC/baoweiluobo iOS.app/Pets/PetsTheme03-hd.png" rc=51 id=7 225 x 1003 @ 32 bpp => 881 KB

    "/Users/yannei/Library/Application Support/iPhone Simulator/7.1/Applications/1FB2A229-F755-4E39-887D-3057C3A692EC/baoweiluobo iOS.app/Towers/tower9.pvr.ccz" rc=13 id=19 512 x 2048 @ 32 bpp => 4096 KB

    "/Users/yannei/Library/Application Support/iPhone Simulator/7.1/Applications/1FB2A229-F755-4E39-887D-3057C3A692EC/baoweiluobo iOS.app/item/item1.pvr.ccz" rc=141 id=3 512 x 2048 @ 32 bpp => 4096 KB

    TextureCache dumpDebugInfo: 33 textures, for 76980 KB (75.18 MB)

     

     

    这些log显示了纹理的名字,引用数,id,大小以及像素的bit值,最重要的是它展示了内存使用情况。消耗了75.18 MB内存。


    这里的“rc”代表纹理的“引用计数”。如果这个引用计数等于1或2的话,那么意味着,这个纹理当前可能不会需要使用了,此时,你可以放心地把它从纹理cache中移除出去。

     

posted @ 2016-06-17 13:28  I'm_Pobaby  Views(462)  Comments(0Edit  收藏  举报