FPS Jitter after activity switch

hi,

usually my game runs fine at 50fps, or whatever it is limited to by vsync.
After i switch to a different activity, for example to a facebook login, a fullscreen ad or a webbrowser and back again, my fps get very inconsistent.
While the FPS stay the same on average, the time between the frames starts to vary a lot.

Here is a log of the times (in milliseconds) before another activity was shown:
I/cocos2d-x(14446): Sleeping took : 17 I/cocos2d-x(14446): Rendering took: 3 I/cocos2d-x(14446): Sleeping took : 16 I/cocos2d-x(14446): Rendering took: 4 I/cocos2d-x(14446): Sleeping took : 16 I/cocos2d-x(14446): Rendering took: 4 I/cocos2d-x(14446): Sleeping took : 16

and afterwards:
I/cocos2d-x(14446): Sleeping took : 31 I/cocos2d-x(14446): Rendering took: 5 I/cocos2d-x(14446): Sleeping took : 3 I/cocos2d-x(14446): Rendering took: 4 I/cocos2d-x(14446): Sleeping took : 33 I/cocos2d-x(14446): Rendering took: 6 I/cocos2d-x(14446): Sleeping took : 9 I/cocos2d-x(14446): Rendering took: 4

the times were taken inside the Cocos2dxRenderer.onDrawFrame method. But i removed the Sleeping inside the function.

    public void onDrawFrame(final GL10 gl) {
        Log.i("cocos2d-x", "Sleeping took : " + (System.currentTimeMillis() - lastRenderEnd) );     
        long renderStart = System.currentTimeMillis( );

        Cocos2dxRenderer.nativeRender();

        Log.i("cocos2d-x", "Rendering took: " + (System.currentTimeMillis( ) - renderStart) );
        lastRenderEnd = System.currentTimeMillis( );
    }

Cocos2d-x version: cocos2d-2.0-x-2.0.4
Android SDK: 13

The effect is also varies from device to device.
On a Motorla Defy the jitter continues until restart. On a Galaxy S3 it jitters for a couple of seconds.

Can anyone imagine a possible source of this problem?

regards
Philipp

There were quite a lot of improvements in the garbage collector for android. So if the Defy has an older android version, it might suffer from “the GC stops the world” issues
Another possibility are ongoing network requests. If the defy only has a single core cpu, this might cause slowdowns on your game thread.

Thank you for your answer.
Unfortunately the jitter also appears after i switch to an empty activity and back. Network traffic cannot be the cause of the problem.
On the defy the jitter goes on forever (tested up to 10 minutes). Also from my point of view there is a too distinct, repeating, pattern that always occurs:

I/cocos2d-x(14446): Sleeping took : 31    <-- long delay time (vsync)
I/cocos2d-x(14446): Rendering took: 5     <-- slightly higher loop time, since fixed time step physics has to catch up
I/cocos2d-x(14446): Sleeping took : 3     <-- short delay time (vsync)
I/cocos2d-x(14446): Rendering took: 4     <-- usual loop
I/cocos2d-x(14446): Sleeping took : 33    <-- repeat...
I/cocos2d-x(14446): Rendering took: 6
I/cocos2d-x(14446): Sleeping took : 9
I/cocos2d-x(14446): Rendering took: 4

delta times for the scheduler are therefor usually around 13/37ms alternating.