adspace


How garbage collection deals with circular references.

Answer Posted / Upendra

Garbage collection in C# handles circular references by marking objects as reachable if they are referenced directly or indirectly by any live object. If an object cannot be reached, it is marked as unreachable and eligible for garbage collection.nHowever, because of the issue with circular references where objects indirectly reference each other without a direct live reference, garbage collection might not immediately collect the unreferenced objects.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is expression tree in c#?

998


Why can't we use a static class instead of singleton?

954


Which namespaces are necessary to create a localized application?

1142


What is an abstract class c#?

969


How to assign Null value to Var?

1064


How do you inherit a class into other class in c#?

995