Conservative garbage collection, Operating System

Assignment Help:

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.


Related Discussions:- Conservative garbage collection

Information system can be divided into three task areas, From hardware pers...

From hardware perspective, every information system can be divided into three task areas Presentation, Application Logic and Data Storage. The R/3 Basis software is extremely s

Major advantages of microkernel approach to system design, Q. What are the ...

Q. What are the major advantages of the microkernel approach to system design? Answer: Benefits usually include the following (a) Adding a new service doesn't require modify

What is an i/o subsystem, What is an I/O subsystem? The control of devi...

What is an I/O subsystem? The control of devices connected to the computer is a main issue while designing operating systems. Because I/O deices differ widely in their function

Explain how the system can deal with the starvation problem, Q. Can a syste...

Q. Can a system detect that some of its processes are starving? If you answer "yes," explain how it can. If you answer "no," explain how the system can deal with the starvation pro

Name the evolutionary process models, Normal 0 false false ...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Unix and linux commands, To explore the UNIX file system, use basic UNIX co...

To explore the UNIX file system, use basic UNIX commands and use a text editor. Task:   1.      Logon to Linux. 2.      Create a directory "Unix" under your home d

What are the necessary conditions for deadlocks?, What are the necessary co...

What are the necessary conditions for deadlocks? 1. Mutual exclusion :  Only one process at a time is able to use the resource. 2. Hold and wait :  A process should be holdi

What is page fault and how to remove page fault?, What is page fault and wh...

What is page fault and what are the steps taken by the OS to remove page fault? A page fault is caused while a page that hasn't been brought into memory is being addressed. The

Garbage collection, The dynamic memory allocator is a layer between the app...

The dynamic memory allocator is a layer between the application and the OS, managing heap objects. When a program requests memory from the allocator (via malloc(), for instance), t

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd