Reference counting, Operating System

Assignment Help:

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.


Related Discussions:- Reference counting

Memory Management Problems, Sir i want formulas in Memory management starti...

Sir i want formulas in Memory management starting from paging till the demang paging in a easy manner for solving problems in competitive exams

Semaphore, mention the three problems that mat be caused by wrong initializ...

mention the three problems that mat be caused by wrong initialization and placement of wait() and signal()operations in the use of semaphore

OS is a resource allocator and control program, why we say OS is a resource...

why we say OS is a resource allocator and control program

Unix, what is difference between file descriptor and file pointer?

what is difference between file descriptor and file pointer?

What is indexed allocation, What is indexed allocation? Every file has ...

What is indexed allocation? Every file has its own block of pointers to the sectors of the file.

What do you understand by “line balancing”? What happens if , What do you u...

What do you understand by “line balancing”? What happens if balance doesn’t exist?

Explain fixed partitioning, Explain fixed partitioning. Partitioning ar...

Explain fixed partitioning. Partitioning are the simpler techniques that don't involve virtual memory. Partitioning has been used in numerous variations in operating systems.

Explain enhanced second-chance algorithm, Enhanced second-chance algorithm....

Enhanced second-chance algorithm. When we increase the second-chance algorithm by considering both the reference bit and the modify bit as an order pair. We have the following

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd