3 ms·
Like every other language used for game development: you don't allocate objects in the render loop. All objects are re-used and go into pools. Malloc isn't free
by xenadu02 9y ago
Like every other language used for game development: you don't allocate objects in the render loop. All objects are re-used and go into pools. Malloc isn't free (heh): maintaining the free lists can kill FPS just as quickly as anything else.
As others have pointed out: the CLR has had a concurrent low-latency GC for a long time now and now that it's all open-source there is nothing preventing Unity from adopting it.
- penetrarthur 9y agoYeah, I am also surprised by the fact that people are constantly nagging about GC. In real gamedev on Unity, memory management is very serious and everything gets pooled. If GC is a problem, you rewrite the code so that it isn't.