Why is there so much GC allocation with GameObject.Activate and Physics2D.SendTriggerContactCallbacks on iOS?

I am profiling my iOS game that has stuttering every 2-5 seconds of moving objects. I am guessing this is likely due to a drop in frame rate and have started profiling.

Here are some screenshots of spikes with GC allocation. How do I figure out which GameObject/Script is causing these issues?

Also, why do I not see VSync on iOS (it should be at 60fps)?


Well activating / deactivating gameobject can be quite demanding. However it depends on what kind of object it is or specifically which components are involved. Physics objects (rigdbodies, colliders, …) need to be added / removed to / from the physics system.

SendTriggerContactCallbacks may depend on what physics callbacks your scripts implement and how many actually receiving a callback. Also keep in mind when you don’t need the callback parameter you should omit the parameter as this would avoid the creation of the collision / contact information.

I don’t quite get what you mean that you “do I not see VSync on iOS”.

Are you actually testing on the device using the remote profiler, or do you test in the editor?