Reference counting doesn't work well with circular references or multiple threads. It also requires an extra field for every object.
There are ways around parts of this, but most people just moved to mark and sweep instead.
(One can use thread-local counters and a global map of what threads have at least one reference to an object, updated only when a reference goes from 0 to 1 or vice versa. Weighted reference counting is an alternative. There are also a couple ways of detecting circular references.)
There are ways around parts of this, but most people just moved to mark and sweep instead.
(One can use thread-local counters and a global map of what threads have at least one reference to an object, updated only when a reference goes from 0 to 1 or vice versa. Weighted reference counting is an alternative. There are also a couple ways of detecting circular references.)