|
|
|
|
|
by imtringued
3095 days ago
|
|
The advantage of reference counting is determinism. Memory will be freed when the last reference is removed. A GC will periodically scan the heap and free memory of an entire batch which makes it more efficient but undeterministic. |
|
You could make the claim that RC is more predictable by humans. I think you just have to decide if that’s true for current and specific implementations of RC and tracing. I am not convinced it is an inherent property of RC - and that the same or greater levels of predictability cannot be achieved in hypothetical or even existing implementations of tracing. What if you only performed traces during times that the user was not interacting? If you can explicitly control that, couldn’t that be even more “predictable” than when releasing a final RC reference and hoping it doesn’t cause a cascading chain of destructors of hard-to-predict size?