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
Making the Transition to Client - Server Programming Making the transition to client - server programming is a significant effort. Client - server applications must be designed

Explain DosCreateThread Functions Used in the OS/2  DosCreateThread(&threadID,MyThreadFunction,arg,flags,stackSize) DosCreateThread creates a thread within the context of th

Q. Consider a system that holds 5000 users. Presume that you want to allow 4990 of these users to be able to access one file. a. How would you denote this protection scheme in

What does it mean for something to be thread-safe? By saying that X is thread-safe, we mean that if multiple threads use X at the same time, we don't have to worry about concurrenc

I am not getting what you have tried to describe here. Can you elaborate more about this, i will be thankful to you. Vinay

The term thread-safe in computer programming describes that routine or portion of the program that may be called from multiple programming threads without uncalled for interactions

Q. What are the three main activities of an operating system in regard to memory management? Answer: a. Keep follows of which parts of memory are currently being used and

importance of Operating system in modern computers. Also explain various functions & types of operating systems

Write a note on multithreading. Multithreading is the capability of an operating system to execute different parts of a program called as threads, at the same time. The program

Explain Terminal Symbols Terminal symbols are literal strings that are forming the input of a formal grammar and cannot be broken down into smaller units with no losing their l