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
Q. Why page sizes always powers of 2? Answer: Recall that paging is executed by breaking up an address into a page and offset number. It is most competent to break the address

Problem 1: (a) What are the likely benefits which an organisation may derive from the planning process? (b) Explain the main reasons why an organisation may fail to plan.

What is an operating system? An operating system is a program that acts as a mediator between a user and the computer hardware. The function of an operating system is to provid

In the mean while the fork() system call the Kernel creates a copy of the parent process's address space and adds it to the child process. But the vfork() system call do no

What is banker's algorithm? Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple examples of each resource type

Q. What are the five main activities of an operating system in regard to process management? Answer: a. The creation as well as deletion of both user and system processes

idle thread The special thread a dispatcher will run when no ready thread is found. The primary purpose of the idle process and its threads is to remove what would otherwise b

How is it different from the unbounded buffer algorithm ? Explain.

Explain the ThreadSwitchWithDelay Function used in Netware ThreadSwitchWithDelay( )   This command is used when threads are waiting for an event or resource but don't want t

How Virtual memory is implemented Virtual memory can be implemented along with Segmentation and Paging