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
Q. We have an OS (operating system) for a machine that uses base and limit registers however we have modified the machine to provide a page table. Can the page tables be set up to

LINUX OPERATING SYSTEM 1. Write a brief explanation about the Linux distribution. 2. Explain the features that Bash shell provides? 3. Who is responsible for managing use

how to move the system app to usb storage

We have talked about blocking locks, which voluntarily yield, and spinlocks, which just spin until they acquire the lock. At ?rst, it seems like spinlocks are verywasteful, and tha

Describe the differences among short-term, medium-term, and long-term scheduling.   Short-term (CPU scheduler)-selects from jobs in memory those jobs that are ready to execu

My code it didn''t run properly ,i tried to pass 2 parameter example : ./a.out ls -ll ,but it execute only the ls instead of the ls -ll ! plz help amd thank you ! #include #inclu

What are overlays? To enable a process to be larger than the amount of memory allocated to it, overlays are used. The idea of overlays is to keep in memory only those instructi

Question: a) Each process is represented in the operating system by a process control block (PCB). The PCB contains many pieces of information associated with a specific proce

Acyclic-graph directories An acyclic graph permits directories to have shared subdirectories and files. The similar file or subdirectory may be in two dissimilar directories. A

Q. In the IBM/370 memory protection is offered through the use of keys. A key is a 4-bit quantity every 2K block of memory has a key (the storage key) associated with it. The CPU