There are many questions in SO regarding the objective c mechanism objective c ARC . Many people ask if ARC replace GC or not, etc. There is even discussion of whether it is wise to switch to ARC from GC for Mac applications (if it does not require a lot of processing complex links in some data types, etc.).
The obvious drawback of ARC is the complete absence of any mechanism for clearing circular links (edit: circular strong links). Here's a very good and simple explanation of memory leaks using ARC What leaks does automatic reference counting in Objective-C not prevent or minimize?
And an interesting overview of the benefits of apple ARC over their GC . http://lists.apple.com/archives/objc-language/2011/Jun/msg00013.html
I understand how GC works and what problems it has, but moving from the C#/.NET world to objective c / Cocoa and reading material about ARC , I still can’t get one simple thing - why is there no background for cleaning cyclic links in the ARC application .
It does not require a suspension of threads, does it? So it's relatively cheap. Is this a problem to implement? A lightweight version of GC that scans the stack, registers, plots, finds circular references and frees memory without pausing applications, sounds cool, no?
Are serious calculations or other resources required? It’s hard for me to imagine how to find circular references without building all the graphs of objects, but assuming that this process is background and continuous, it should be fine even in this way?
.NET 4.5 GC ( http://blogs.msdn.com/b/dotnet/archive/2012/07/20/the-net-framework-4-5-includes-new-garbage-collector-enhancements-for-client -and-server-apps.aspx ) has major performance improvements, but will having a circular set of links in the ARC system make the second winner? What are the next steps in the evolution of the ARC system? If this is possible and will ever happen, will ARC have a collection of circular references, can it completely replace GC , or is the next GC gene (with even greater performance) going to eliminate ARC systems?
UPD: Please do not publish links to weak , I know how to handle circular links in ARC, and this is obvious, the question is whether it is possible to add a circular link collector to an existing ARC mechanism, since it would be as powerful and universal as modern gc