1-3 second "spikes" (not GC?) on Android

I’m experiencing 1-3 seconds long cpu “spikes” on my Samsung Galaxy Nexus every now and then. It goes from around 45 fps to around 30 fps for 1-3 seconds even while having the game paused with Time.timeScale = 0.00000001f. It’s not a single script that runs slower, it’s everything from rendering, overhead etc. Also, since the game is paused all the other profiling such as draw calls, audio sources etc are flatlined.

I’ve made a script that checks if garbage collection is run (on update check if heapSize is less than heapSizeLastFrame) but there’s no collection before, during or after the spikes. They seem totally unrelated. Maybe you can’t check garbage collection like this?

I have no other apps running on the phone.

Has anyone got any idea what this could be?

If you have the pfiler, we need more info.

If you don’t have the profiler, how can you say its not a script that is causing it.

And no, Time.timeScale = 0.00000001f is not paused, why would you think that. Time.timeScale = 0 is paused. And even while paused, I believe everything still gets Update() calls, just with Time.deltaTime as 0 (or in your case, a very very small number). Do some debug logging to verify if this is the case.