Actually to clarify a little more.
The garbage collector will pause the application thread when it frees up allocated memory.
Garbage is memory memory is not a problem freeing it is as that is the meaning of collecting it.
Real world meaning … your game stutters slightly if you make reference type objects and let them go out of scope each frame or if you box structs or by a number of other odd cavets. The more you do that the faster the gc collects the now collectable un-usable memory and the more your game stutters.
Primitive types and structs are in general allocated on the stack BUT not guaranteed to be as this is a … quote ‘implementation detail’ unquote.
Real world meaning 1. A ton of regular vector2s in a method makes no garbage.
Real world meaning 2. If i put a struct in a class its gonna be on the heap. or If i make a really really big struct it can end up on the heap or by a number of other odd cavets…
So monitor the gc collections with a on screen display just like you would the frame rate for performance.
It’s what i do so that it doesn’t turn into a problem in the first place.
