So I’m going through the scenes of my game with the Profiler and trying to get the GC Allocs down to zero. An issue Im finding is that some 3rd party assets I’m using are doing GC Allocs every few frames. For example, InControl is doing a 16B GC Alloc every 5 or so frames (profiled on an Android tablet.).
So my question is - is this amount of GC Allocs is a problem? On mobile, how much GC Alloc can you get away with each frame?
I think that’s probably fine. If you’re concerned with garbage piling up, you can call GC.Collect() at places where it’s acceptable to have a hiccup in frame rate, like during a loading screen or when the player opens a menu. That will minimize the chances of it happening in the middle of gameplay.
A few bytes per frame will take a long time before any hiccup, possibly minutes - haven’t checked, so you can probably call GC.Collect() whenever you open a menu or do something non realtime-y to clean up.
Although I do prefer assets that allocate nothing, and would love Unity to keep working on mitigating gc performance issues.