question

C. Ata avatar image
C. Ata asked

Zombie Processes

Hi All, I don't know if this is a bug in my code, Kindle Fire OS issue, or a Whispersync/GameCircle issue. Basically, after repeatedly entering and exiting my cocos2d-x, whispersync and gamecircle supporting game, I start to see zombie process being created. In my AndroidManifest I have launchMode="singleTask" for my main activity. To reproduce this issue, I just start entering and exiting the game with home and/or back buttons. Eventually I see a new process get spawned, and old one just lingers around in the system, never to be freed until the device is turned off and back on. Has anybody seen this issue? I'm not getting any errors, so this has been particularly difficulty to resolve. Any suggestions would be awesome, Thanks
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Ata, How do you detect the currently running process in the device? Are you running "ps" command in adb shell? Can you please paste the ps output for those zombie and app processes? Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

C. Ata avatar image
C. Ata answered
Hi Sujoy, Thanks for the response. I've tested some more and realized that it's a different scenario that causes this. Nonetheless, this shouldn't be happening on an Android device (as far as I know). Basically the second process seems to be spawned on launch simultaneously with the primary process. To reproduce: *adb shell ps | grep mygame app_27 1758 100 616920 100236 ffffffff 00000000 S net.mycompany.mygame - Here we manually kill the process (to simulate low memory condition) *adb shell ps | grep evolution - Here you can see the process is gone. *(start up game) ⇒ DOUBLE LAUNCH app_27 2079 100 547608 96596 ffffffff 00000000 S net.mycompany.mygame app_27 2140 2079 504132 38396 ffffffff 00000000 S net.mycompany.mygame As you can see there are 2 processes with unique PIDs. When looking at them with "top" - only one of them is active and consuming any cpu while the game is running. There are no crashes reported in logcat. I'm using cocos2d-x and I'm not doing anything abnormal (I'm not spawning any processes or anything like that). This is difficult to reproduce but I'm concerned that after a week or a month of gameplay, the device could get bogged down with zombie processes. Also, on another note, I have yet to be able to reproduce this issue in the emulator. So far I've been able to reproduce the issue on Kindle HD and 7" running Android 4.0.4 and 4.0.3 Thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

C. Ata avatar image
C. Ata answered
Hi Sujoy, I've narrowed this down further. It seem to be caused directly or indirectly by AdMob interstitial ad loading. I posted a question about it here: https://groups.google.com/forum/?hl=en_US#!topic/google-admob-ads-sdk/1G53WGConvA Thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Thanks for sharing it.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.