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

Describe the concept of transaction atomicity, Q. Describe the concept of t...

Q. Describe the concept of transaction atomicity? Answer: A transaction is a sequence of read as well as writes operations upon some data followed by a commit operation. If the

Read-write locks, Consider a large web-based database. In some sense, Googl...

Consider a large web-based database. In some sense, Google is sort of like this. There might be many users who want to read from the database, but only a few users who are allowed

List sample file types, List sample file types, based on use, on the VAX un...

List sample file types, based on use, on the VAX under VMS.  source programs (.BAS, .FOR, .COB, .PLI, .PAS, .MAR)  data files (.DAT)  text files (.TXT)  command proced

#network OS, what are the design issues of network OS

what are the design issues of network OS

Facility location, What is the essence of facility location in production o...

What is the essence of facility location in production operation management

Define deadlock prevention, Define deadlock prevention. Deadlock preve...

Define deadlock prevention. Deadlock prevention is a set of process for ensuring that at least one of the four essential conditions like mutual exclusion, hold and wait, no pr

Define an assembly language, Define an assembly language  Assembly lan...

Define an assembly language  Assembly language stands for a Low level programming language

Page faults, Assume there are only 4 page frames in the physical memory, fo...

Assume there are only 4 page frames in the physical memory, for the following reference string: 1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2, 8. a) What i

We can view an operating system as a resource allocator, We can view an ope...

We can view an operating system as a resource allocator. Explain. We can outlook an operating system as a resource allocator. A computer system has Many resources (software and

How can a user program disturb the normal operation, How can a user program...

How can a user program disturb the normal operation of the system? a) Issuing illegal I/O operation. b) By accessing memory locations within the OS itself. c) Refusing to

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