Hello Everyone This question is about Computer Science from

Hello Everyone,

This question is about Computer Science from the book Programming Langauge Pragmatics. It is about Composite Type in Compiler and Interpreter design. Thank you for the help.

(a): Occasionally one encounters the suggestion that a garbage-collected language should provide a delete operation as an optimization: by explicitly delete-ing objects that will never be used again, the programmer might save the garbage collector the trouble of finding and reclaiming those objects automatically, thereby improving performance. What do you think of this suggestion? Explain.

(b): Alternatively, one might allow the programmer to “tenure” an object, so that it will never be a candidate for reclamation, Is this a good idea?

Solution

(a) When an object is no longer used, the garbage collector reclaims the underlying memory and reuses it for future object allocation. This means there is no explicit deletion and no memory is given back to the operating system. Removal of garbage records does not affect normal performance, so this is not a performance optimization. For the purpose of minimizing the effect on performance, it is also possible to carry out garbage collection in the background. The balance created by the wear leveling disseminates the wear out stress over the array of blocks instead of on some particular hot spots. Hence, the larger the memory density, the lesser the wear out per cell would be.

(b) The process of reclaiming the dirty pages is as follows, valid pages containing data is copied to a new memory block which has free pages and the old block is then completely erased, readying it to be used in future. However, as the time needed to make a copy of valid pages and erase the entire block can be high, some file systems have the concept of garbage collection in a background process performed when the device remains idle.

To conclude we can state that reducing the number of Aggressive Garbage Collections is a significant optimization in terms of performance. In a write operation, a considerable amount of time is spent of finding free chunks to write data, and Garbage Collections are performed whenever there is scarcity of free blocks to convert deleted blocks into erased blocks. Therefore by reducing the number of Aggressive Garbage Collections in write operation, the performance of disk write is also improved.

Hello Everyone, This question is about Computer Science from the book Programming Langauge Pragmatics. It is about Composite Type in Compiler and Interpreter de

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site