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
p0A B C D A B C D A B C D 2 0 12 2012 1000 1354 0632 0014

What is scheduler? A process migrates among the various scheduling queues throughout its life time. The OS must choose processes from these queues in some fashion. This selecti

Q. Does Windows XP offer any user-mode processes that enable it to run programs developed for other operating systems? Describe two of these subsystems. Answer: Environmental

Q. How could a system be designed to allow a choice of operating systems to boot from? What would the bootstrap program need to do? Answer: Delieve a system that would like to

Q. What resources are utilized when a thread is created? How do they vary from those used when a process is created? Answer: For the reason that a thread is smaller than a pr

Explain the Request/Response Interface   Many issues are involved in providing a procedural interface for client functions to interact with server components. First off, since

In a table format, discuss the differences between the fixed partition and the variable partition memory organization in terms of the basic idea, memory structure, advantages

Q. What protection problems may occur if a shared stack is used for parameter passing? Answer: The contents of the stack could be conciliation by other process(es) sharing th

Operations that are to be performed on a directory are Search for a file: We are able to find all files whose names match a exact pattern. Create a file: New files requi

Q. In following Section we mentioned that disabling interrupts frequently could affect the system's clock. Describe why it could and how such effects could be minimized.