4 ms·
GC determinism is one of the things you get. Another one is non cooperative asynchronous termination.
by asabil 2y ago
GC determinism is one of the things you get. Another one is non cooperative asynchronous termination.
- neonsunset 2y agoPretty much all efficient GC implementations are inherently non-deterministic, even if predictable. How can this improve predictability of GC impact?
- asabil 2y agoNo global GC. Each erlang process does its own GC, and the GC only happens when the process runs out of space (ie. the heap and stack meet). You can for example configure a process to have enough initial memory so as not to ever run into GC, this is especially useful if you have a process that does a specific task before terminating. Once terminated the entire process memory is reclaimed.
- neonsunset 2y agoThere is no free lunch in software - the tradeoff is binary serialization and/or data copying over simple function calls. The same goes for GC - for efficient GC, it has to come with quite involved state which has additional cost of spawning. At this point, might use bump allocator, or an arena. Either way, Gen0 (it's a generational GC) in .NET acts like one, STW pauses can be sub-millisecond and are pretty much non-issue, given that you don't even need to allocate that often compared to many other high-level languages.