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
Q. Benefits and Drawbacks of Batch System? Benefits of Batch System: Move much of the work of operator to computer. Increased performance as it was possible for j

How can a user program disturb the normal operation of the system? a) Issuing illegal I/O operation. b) By accessing memory locations within the OS itself. c) Refusing to

Developing an application for android encompass different steps as follows: Setup:  Development environment is prepared during this phase. This includes downloading and installi


List ways to share files among directories in operating systems. a. Copy file from one account into another. b. Link directory entry of "copied" file to directory entry of o

What is a file path name? A list of the subdirectories, directories, and files we must traverse to reach a file from the root directory.


Android operating system is an open source, Linux-based Smartphone OS. It is the world's most popular mobile platform with more than 700,000 applications and 25 billion downlo

What is parsing Parsing is the procedure of analyzing a text, made of a sequence of tokens, to define its grammatical structure regarding to a given formal grammar. Parsing is

How can deadlocks be represented? Deadlocks are able to be described in terms of a directed graph called as a system resource-allocation graph. This graph contains of the foll