Slow Response coming out of sleep mode

Slow Response coming out of sleep mode
0.0 0


Hi. I have an issue with my game in that if the device is put into sleep mode while the game is running, then woken up, the game takes about 1-2 sec to be responsive again. In some cases the QA testing has seen the game terminate because its too unresponsive at this stage. Where should I be looking to see if I can improve the waking up times here?



My problem is more serious~
When resume app from background, it takes up to 30 minuts or more, or never resume …

LG P990/Android 2.2: 10 seconds
HTC G14/Android 4.0: 30 seconds, or never
Huawei Honor: Never



Anyone out there got a fix?


Bump, anyone know where to begin looking for a solution? Resume right now takes around 5 seconds, and since other games resume more/less instant it should be possible to fix I recon.


CCTextureCache reloads all textures in a blocked way, if you have many textures, “force close” might appear.

Currently I have a solution, it works, but not perfect:

  1. modify CCTextrueCache and VolatileTexture, add something like this:

    //save the texture list to be reloaded
    int prepareReloadTextures();
    //reloads 1 texture in each call and returns true if finished
    bool reloadNextTexture();

  2. Create a fullscreen CCNode as a “loading screen”, which shows “Reloading”, and calls reloadNextTexture() repeatly

    class ReloadingNode : public CCNode {

    bool init() {
    // show something, like a black background with a label “RELOADING…”

     return true;


    virtual void onEnter() {

    void update(cocos2d::ccTime dt) {
    if( !cocos2d::CCTextureCache::sharedTextureCache()->reloadNextTexture() )

     // reload finished


  3. In main.cpp, there’s a line:


remove it, and shows ReloadingNode at the top of screen
Make sure it’s the top most node, and won’t be removed before all textures been reloaded.

Good luck~

UPDATE: it’s better to call removeUnusedTextures() before reloading