How should I account for the GC when building games with Unity?
- by Eonil
*As far as I know, Unity3D for iOS is based on the Mono runtime and Mono has only generational mark & sweep GC.
This GC system can't avoid GC time which stops game system. Instance pooling can reduce this but not completely, because we can't control instantiation happens in the CLR's base class library. Those hidden small and frequent instances will raise un-deterministic GC time eventually. Forcing complete GC periodically will degrade performance greatly (can Mono force complete GC, actually?)
So, how can I avoid this GC time when using Unity3D without huge performance degrade?