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
What is Demand paging? Virtual memory is commonly executed by demand paging. In demand paging, the pager brings only those essential pages into memory instead of swapping in a

Now let us present an implementation of a producer-consumer system using condition variables. This implementation works. dequeue() lock(A) while (queue empty) { wait(A, C)

whats the use of using ipc

Q. Presume that a distributed system is susceptible to server failure. What mechanisms would be needed to guarantee the exactly once semantics for execution of RPCs? Ans

What is reference string We evaluate an algorithm by running it on a definite string of memory reference and computing the number of page faults. The string of memory reference

How do we keep track of where the free pieces of memory are? One idea is to maintain a set of linked-lists of free space; each linked-list will store free chunks of some given size

Define the Non Monolithic Coding First off, client - server developers must adopt a new programming mindset. Much as with the shift to object - oriented design, developers sho

Questiion 1 What is RTOS? What are its requirements? Questiion 2 Explain the structural elements of a real time system mode Questiion 3 What is kernel? Explain abo

What are Tree-structured directories We can generalize the directory structure to a tree of arbitrary height. This permits the user to create their own sub directories and to c

Explain Structure The Grammar for programming language is a formal description of Structure