Reference count, don't garbage collect
This debate has gone round and round for decades. There are no hard lines; this is about performance tradeoffs, and always will be.<p>Perhaps the biggest misconception about reference counting is that people believe it avoids GC pauses. That&#x27;s not true. Essentially, whereas tracing GC has pauses while tracing live data, reference counting has pauses while tracing garbage.<p>Reference counting is really just another kind of GC. I&#x27;d highly recommend perusing this paper for more details:
A Unifying Theory of Garbage Collection.
<a href="https:&#x2F;&#x2F;web.eecs.umich.edu&#x2F;~weimerw&#x2F;2012-4610&#x2F;reading&#x2F;bacon-garbage.pdf" rel="nofollow">https:&#x2F;&#x2F;web.eecs.umich.edu&#x2F;~weimerw&#x2F;2012-4610&#x2F;reading&#x2F;bacon-...</a><p>One of the biggest issues with reference counting, from a performance perspective, is that it turns reads into writes: if you read a heap-object out of a data structure, you have to increment the object&#x27;s reference count. Modern memory architectures have much higher read bandwidth than write bandwidth, so reference counting typically has much lower throughput than tracing GC does.