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
How is memory management done using linked lists?   Each one node of the l list will have 4 fields as follows 1-this tells whether it s a hole or a process 2-starting ad

Buffering Messages exchanged by communication processes reside in a impermanent queue. Such a queue can be executed in three ways. Zero capacity: The queue length is 0.

Q. The term "fast wide SCSI-II" signifies a SCSI bus that operates at a data rate of 20 megabytes per second when it moves a packet of bytes among the host and a device. Presume t

List and discuss the various services provided by the operating system. Program execution - system capability to load a program into memory and to run it. I/O operatio

For this exercise I wanted to give you some real-world examples of useful bash scripts. Therefore, you will write a couple of scripts that I actually use in my teaching to automate

What is an acyclic graph? A tree that has been corrupted by links to other branches, but does not have any cyclic paths in it.

Q. Show that a few schedules are possible under the two-phase locking protocol however not possible under the timestamp protocol and vice versa. Answer: A schedule that is auth

Question 1 Describe about the shells of Linux operating system Question 2 Describe briefly about GNOME desktop Question 3 Write note on the following- Encryp

Write a short note on file organization and access. There are three methods to access files 1Record Access 2Sequential Access 3Random Access The record access

In the mean while the fork() system call the Kernel creates a copy of the parent process's address space and adds it to the child process. But the vfork() system call do no