Mark-sweep, Operating System

The objects that a program can access directly are those objects which are referenced by local vari-ables on the processor stack, or by any global/static variables that refer to objects, or by variables in CPU registers. In the context of garbage collection, these variables are called the roots. An object is indirectly accessible if it is referenced by a ?eld in some other (directly or indirectly) accessible object. An accessible object is said to be live. Conversely, an object which is not live is garbage.

Note that heap objects which are live are indirectly accessible from the roots or other heap objects. The idea of mark-sweep is relatively straightforward. We start at the roots, and recursively visit every object accessible through pointers, marking them as live. At the end of the process, every thing not marked is considered garbage and will be deleted. Notice that mark-sweep can perform lazy garbage collection, in the sense that it does not necessarily need to remove the garbage immediately.

Note thatmark-sweep does not clean upmemory which is allocated, but simply never used. Also, periodically we have to visit all objects recursively, starting from the roots. For a large program, this will be slow. This is a problem with the traditional mark-sweep algorithm.

Posted Date: 3/13/2013 2:55:14 AM | Location : United States







Related Discussions:- Mark-sweep, Assignment Help, Ask Question on Mark-sweep, Get Answer, Expert's Help, Mark-sweep Discussions

Write discussion on Mark-sweep
Your posts are moderated
Related Questions
Resolution of externally defined symbols is carried out by    Resolution of externally defined symbols is carried out by Linker

Question 1 Explain single Partition Allocation and Multiple Partition Question 2 What is PCB? What useful information is available in PCB? Question 3 Explain Preemptive and No

How File record length should be chosen File record length should be selected to match the data characteristics

Differentiate pre-emptive and non-preemptive scheduling In a pre-emptive scheduling technique, CPU can be taken away from a process if there is a requirement while in a non-pre

Medium term scheduling is form of the swapping operation. This attaches to processes that are in a suspended or blocked state. They are swapped out of real-memory storage until t

Q. The Sun Ultra SPARC processor has numerous register sets that describe the actions of a context switch if the new context is previously loaded into one of the register sets. Wha

What are the requirements for solution of critical section problems? Mutual exclusion : If process p is implementing in its critical section then no other processes can be exe

Problem 1. List out the conditions that result in Deadlock situations. Illustrate deadlock situation with a simple graphical notation Listing conditions for deadlock occu

Question: (a) Explain the similarities and differences between two different threads running in the same process and two independent processes. When would you want to use two t

socket based fortune teller sever.your program should create a server that listens to a specific port when a client receives a connection the server should respond with a random fo