Spikes on iPhone3/4 every other minute. Any ideas how to find out why and/or get rid of them?

Hello,

we’re making a game for iOS. When testing on iPhone3 and 4, the performance is fine, but every other minute we get a very short but noticable stutter.

Normally I’d suspect that’s the garbage collector, but the profiler shows nothing pointing in that direction - rather stable memory, no garbage collector peaks in the profiler. Instead, I got those candidates:

  • Mesh.DrawVBO
  • CullSceneObjects
  • Device.Present
  • Mesh.SubmitVBO
  • And occasionally Physics.Simulate
  • Sometimes but rather seldom one of our scripts

Here’s a link to some profiler example pictures - note that I’m not on the frame so you can see the actual spike, but I markek the method so you can see which one causes the spike.

Assuming that it might have to do something with the level we had, I made a simple level with a static camera. The character you see rolls and jumps. There is a simple NGUI gui involved to control the character. Nothing else is happening - still, spikes.

Here are the logs from the iPhone Unity internal profiler:

I’ll try to make an even more simple level, but I thought it couldn’t hurt to ask now - maybe somebody has an idea.

We’re using:

  • Unity 4.5
  • NGUI 2.7
  • 2D Toolkit, newest version

So, in conclusion, we get a noticable stutter every other minute even in a rather simple level. We aren’t creating new objects as far as I see and memory seems fine to me.

There is a simple NGUI gui involved to control the character. Nothing else is happening - still, spikes.

Test removing NGUI, if the spikes go way you can also ask the author who might know how the problem is related to that plugin.