Garbage collection
Also called: GC
Related terms: allocation, hitch
In languages such as C# and JavaScript, memory that is no longer used is reclaimed automatically by a garbage collector. When it runs, the game may freeze for several milliseconds. The player feels a hitch.
The fix is to create less garbage during play: reuse objects with an object pool and avoid making temporary objects every frame.
- Further reading
- Unity: Garbage collection best practices