Conservative garbage collection, Operating System

Conservative GC can be used for languages such as C and C++, which were not explicitly designed for garbage collection. This is a non-copying technique. A conservative garbage collector is one that, instead of knowing the exact location of each object, discovers the set of live objects by scanning a region of memory, looking for areas that may be objects. Because C and C++ allow casting, anything that can hold a pointer could conceivably be a pointer, such as an unsigned long which is cast as a pointer, or a ?oating-point type which is cast as a pointer, etc. Conservative GC more or less uses the "duck test", paraphrased here as "if it looks like a pointer and acts like a pointer, it's probably a pointer". Starting from the roots, we can ?nd all objects which look like pointers, and the objects to which they would point if they were in fact pointers, and mark those objects as live. By doing this, we can provide garbage collection to languages which otherwise would not support it.

The possible objects found may or may not actually be objects, but we are ensured that all live objects referred to from that particular area are found by the garbage collector. Since we must discover the areas that might be objects, we also have to know how to identify pointers; usually, if something looks like a pointer, we assume it is a pointer. Then, conservative GC traces through those "pointers", marking everything that is still live.

Some of the drawbacks of this method are: 1) areas of memory that look like pointers to objects, but aren't, cause garbage objects to be retained as long as the fake pointer exists; this increases memory usage of the garbage collector, and can cause other limited resources to be exhausted; and 2) the methods of ?nding exactly which areas to trace aren't always portable.

Posted Date: 3/13/2013 3:01:13 AM | Location : United States







Related Discussions:- Conservative garbage collection, Assignment Help, Ask Question on Conservative garbage collection, Get Answer, Expert's Help, Conservative garbage collection Discussions

Write discussion on Conservative garbage collection
Your posts are moderated
Related Questions
Explain briefly the working of semaphore with example ? The E.W. Dijkstra (1965) abstracted the key idea of mutual exclusion in his concepts of semaphores. Definition A s

Debugging a multi threaded program The following list points out few of the more frequent oversights and errors that can cause bugs in multithreaded programs. 1.    Ephemeral

Consider a particular system that does not have an interrupting clock.  The only way a thread can lose the processor is to voluntarily surrender it.  Additionally, the operating sy

Q. Advantages and disadvantages of multiprogramming? Advantages 1.    High CPU utilization. 2. It appears that many programs are allotted CPU almost concurrently. D

There are three kinds of Data Abstraction: Physical level: The minimum level of abstraction defines how data are saved. Logical level: The next bigger level of a

Define the WindowsNT WindowsNT provides a two-level approach to resource management: process and thread. The process is the uppermost level and contains most of the application

what is the latest OS of ANDROID in US

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

Define Name of some language processors?   Name of some language processors are as follow: Assembler, Compiler and Interpreter

Linked allocation With linked allocation, every file is a linked list of disk blocks; the disk blocks might be scattered anywhere on the disk. The directory has a pointer to th