Employers - Post Free Jobs
Forum guidelines
AuthorQuestion
Circular references in C#
Posted on: 20 Feb 2012
Hi friends,

I want to know that what are the circular references? Explain how garbage collection deals with circular reference?

AuthorReply
Re: Circular references in C#
Posted on: 20 Feb 2012  
Hi Amit,

A circular reference is a series of references when a formula refers back to its own cell, either directly or indirectly and the last object references the first, resulting in a closed loop. Also it is a run-around where in two resources are interdependent on each other.

The methods to deal with circular references are:
• Weighted reference counting
• Indirect reference counting

There are some ways to handle problem of detecting and collecting circular references with the help of garbage collection.
• The system may explicitly forbid reference cycles.
• Systems ignore cycles if it have small amount of cyclic garbage.
• You can also periodically use a tracing garbage collector cycles



Refer

http://www.dotnetfunda.com/interview/exam3632-what-are-circular-references-explain-how-garbage-collection-deals-with-cir.aspx


Thanks

If this post helps you mark it as answer
Thanks

Re: Circular references in C#
Posted on: 20 Feb 2012  
Although circular references are a problem in systems such as COM which use 'reference counting' to decide when an object's memory can be reclaimed, they're not a problem in systems which use a 'tracing garbage collector' such as .NET.


Employers - Post Free Jobs

SPONSORED BY

Offshore Software and Database Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.