3 ms·
Those games will have been written in such a way as to avoid allocations like the plague, giving the GC very little to do. Sometimes your game can be written th
by Scramblejams 6y ago
Those games will have been written in such a way as to avoid allocations like the plague, giving the GC very little to do. Sometimes your game can be written that way -- sometimes it can't.
- pjmlp 6y agoJust like you have to avoid malloc() in C written games.
- jstimpfle 6y agoFirst, you don't have to avoid malloc() or similar allocators in games necessarily. You should avoid it in performance constrained situations. And you only should avoid calling malloc. It's not necessarily a problem to use these allocations in those situations. That's quite unlike Java, unless you're a GC wizard, and I'm not sure how far even those wizards can circumvent problems. Second, to my knowledge it's still very cumbersome to avoid GC allocations in Java. By comparison, it's easy to reduce calls to global heap allocators in C.
- pjmlp 6y agoFirst, also possible in GC enabled languages. That is what profilers are for. Second, it is relatively easy to do native memory allocation in Java, but apparently people keep forgetting to learn their toolbox properly. Third, calling malloc() is such an issue that there used to be companies specialised in selling optimised versions of malloc()/free().
- jstimpfle 6y agoOh, come on.