Re:Friendship ended with the garbage collector
by zozbot234 on Friday August 27, 2021 @05:09AM
(#28325704)
You can use arenas for the cases where you really can't do without delayed/batched deallocation. But deterministic deallocation as provided by RC is a very good default for many cases, including where low-latency is a goal.
[ Parent
| on HN ]
Re:Friendship ended with the garbage collector
by p_l on Friday August 27, 2021 @07:20AM
(#28326375)
RC is not deterministic. That's the whole thing - when you free a refcounted object, you do not deterministically know how long is it going to take, and on systems that try to avoid RC-induced pauses, you don't get to know when the memory is going to be released.
If you want to talk determinism, you need to actually invest into deterministic behaviour - something that either requires dropping dynamic memory allocation altogether, or tends to go for GC with known determinism guarantees (for example, IBM Metronome).