this new type of problem facing in game . can have implemented code game . facing problem it. happen when play more 5-6 times game gets slower , means can feel it's going on slow. it's fps 60 fluctuation in fps takes place between 60 30.
in game i've implemented arc. can see every time number of object present in scene same.
i have used instruments check memory leak in game there no memory leak in game. can't show code because confidential.
but couldn't able solve problem. know can reason behind , how can solve issue.
any kind of can helpful
although dont use apple toys this, perform heapshot-like analysis every time run apps : facility built-in every 1 of classes, enable me determine number of instances allocated (not deallocated) @ point during program execution. bit of work (say approximately 1 minute) per class when add 1 project, life saver on life of project.
coming question above in comments, no have no clue 500k. person can figure out @ moment you. if game has logical point (like game main menu) can come before quitting app (i mean hard kill), @ place start doing this, after menu drawn :
// below code cocos2d 2.x nslog(@"*** before purge ***"); [[cctexturecache sharedtexturecache] dumpcachedtextureinfo]; [ccanimationcache purgesharedanimationcache]; [[ccspriteframecache sharedspriteframecache] removespriteframes]; [[ccdirector shareddirector] purgecacheddata]; [self scheduleonce:@selector(dumptextures) delay:0.5f]; // let run loop cycle bit // give chance auto-release objects // disposed pool ... -(void) dumptextures { nslog(@"*** after purge ***"); [[cctexturecache sharedtexturecache] dumpcachedtextureinfo]; }
and examine result. texture cocos2d still holding ... memory hog far. dont think 5-6 times 500k make of difference in game peaks around 140mb.
Comments
Post a Comment