by codexon · 11y ago · 0 comments
That is why python will occasionally run a mark and sweep GC even though it says it uses reference counting.
Circular references aren't easy to avoid, sometimes there can be more than 3 levels of indirection. The mental overhead of preventing circular references is often times as high as manually managing memory yourself.
If it was as good as you suggest, every new language would be using reference counting and not occasionally run mark and sweep.