← Back to context

Comment by psyc

8 years ago

https://docs.unrealengine.com/en-us/Programming/UnrealArchit...

I know very little about it, but in general there's a lot more information in the docs about the Garbage Collector than there is about how to not use it.

TIL (thanks for the correction!) I guess they do this to break reference loops. The difference I guess is that it only applies to UObject derived things, which are higher level objects, rather than across your entire codebase. I’ve never seen GC take up processor time, but our project doesn’t have a lot of runtime churn of objects.

Unreal does use GC and it is the stop the world variety, yet unlike unity the GC has never even showed up for us as a problem. I cannot tell you why or how but Unreal just handles GC better than Unity. I am speaking from my experience of shipping a commercial game on console with Unreal. Maybe things are worse on mobile.

  • The difference is going to be what type of objects generate garbage. In Unity, everything you instantiate has the potential to make garbage (because C#), but for UE, it’s mostly top level objects which don’t have a lot of churn.