But it really depends on what you're doing. You can use the wrong tool for a job, but you can also use the right tool. It depends on the job.
I'm not saying manage memory manually. You can switch to a language that is reference counted. Then at least that abstraction guarantees deterministic deallocation.
That comes with another set of trade-offs such as having to pay attention to atomic reference counts, making sure there's no cycles, maybe even treating some graphs as arenas to avoid chained deallocations, but the abstraction itself is designed to be deterministic and is more easily controlled.
One does not have to live with the tradeoffs that C#'s default GC makes. One just needs to understand how the GC works and how it is controlled.
To be fair, it is also probably the number one cause of long hitches in poorly optimized UE games, and also the main contributor to class of use-after-free bugs (persisted native pointers and references to objects that weren't properly added to the object graph, though goes away with proper usage of weak object pointers and the like) so it is very much a double-edged-sword.
Agreed that it’s no longer a bottleneck for games; profile—and-optimize approaches are very effective and the tooling has never been better.
Or rather GC done explicit.
You control when and where and how garbage gets collected in various buckets and disposed off.
Without the performance hit of fully automatic GC.
> Risking memory leaks is crazy when it's not something the customer is demanding.
Memory leaks have NEVER been a significant source of bugs.
Memory corruption has always been the problem (lack of memory safety, ie. operating in perpetual unsafe block), not the memory leaks.
Memory leaks are relatively trivial to track and account for in comparison.
Arenas avoid most of the performance problems of malloc/free.
I think the bigger problem with arenas and manual management is memory lifetime is very hard to get right, particularly in the context of concurrent operations. It also cuts away algorithms you can do.
Sure, but they're not fully general, which is why you also need malloc/free for things that don't work well in arenas (or write the equivalent of malloc/free on top of arenas, which is what you need to do in Goose: https://github.com/aardappel/goose/blob/master/bench/kostya/...).
Also, arenas can be an even better fit for languages with good GCs than languages without a GC.