Reference counting, Operating System

The idea of reference counting is to maintain, for every object, the total number of references to that object, i.e. the number of "incoming" pointers. Whenever the number of references is zero we know that the object is not accessible through any pointers, and thus it is garbage. Also, whenever we choose to delete some useless object,we have to recursively check that object to see if it contains pointers to other objects; if so, we have decrement the reference counters for those objects as well. One problem of reference counting, though, is how to deal with cycles. Suppose object A points to B, and B points to A. If these objects can only be reached through each other, we have to free them too, even though their counters are not zero! Note that cycles can common inmany data structures; for example, consider a doubly-linked list. The commonly adopted solution to this problem is to run mark-sweep now and then, in order to remove cyclic references, and then run normal reference counting on the rest of the time.

Posted Date: 3/13/2013 2:56:10 AM | Location : United States







Related Discussions:- Reference counting, Assignment Help, Ask Question on Reference counting, Get Answer, Expert's Help, Reference counting Discussions

Write discussion on Reference counting
Your posts are moderated
Related Questions
How File record length should be chosen File record length should be selected to match the data characteristics

How does communication takes place in a distributed system? Distributed systems depend on the networking for their functionality. A network is a communication path among two


how it is work.

Smith, who is a civil engineer, purchased a 30-hectare block of land in Australia in 1986 and used two hectares of it as a main residence. The part that was not main residence cost

Broken data into small packets allow time division multiplexing. In TDM every packet leaves the sender and is switched on the shared interaction channel through a multiplexer. At t

File allocation using I nodes. This method is used to decrease the size of the table in the above method. Every file will have an I-node list. Allow a file have 15 pointers a

Garbage collectors trade space for time. If we collect all the time (which requires a lot of processing time), the GC allocator will use the least memory possible. On the other han


Define what is Dispatcher In the Worker Model, it is the task of the Dispatcher to spawn a thread for every client-to-server connection. The Dispatcher acts as the go-between o