Question: 18.7 (7) Describe strategies for managing memory, assuming that automatic garbage collection is not available. Your answer should provide guidelines that a programmer could use

18.7 (7) Describe strategies for managing memory, assuming that automatic garbage collection is not available. Your answer should provide guidelines that a programmer could use during coding. system for text manipulation. The system often creates one large string in contiguous meinory from several smaller strings. You cannot waste memory and cannot set an upper bound on string length or the number of strings to combine. Write pseudocode for a method thai comibines strings, recovering memory that is no longer used b. A mutipass conpiler. Objects are created dynamically. Each pass examines the objects created on the previous pass and produces objects to be used on the next pass. The computer systern on which the compiler will run has a practically unlimited virtual address space and an operating system with a good swapping algorithm. The methods in the run-time library for allocating and deallocating memory dynamically are inefficient. Discuss the relative merits of two alternatives: (1) Forget about garbage collection and let the operating system allocate a large amount of virtual memory. (2) Recover deallocated objects with garbage col- lection c. Software that runs for a long time, such as banking software or an air traffic control system. You have the same computer system and run-time library as described in Exercise 18.7(b). Discuss the relative merits of the two approaches d. A method which may create and return an object that uses a large block of memory Discuss the relative merits of the following two approaches: (1) Each time the method is calle d, it destroys the object created the last time it was called, if any. (2) Each time the meth- od is called, it may create a new object. It is up to the calling method to destroy the object when it is no longer needed. Comment on these two approaches 18.7 (7) Describe strategies for managing memory, assuming that automatic garbage collection is not available. Your answer should provide guidelines that a programmer could use during coding. system for text manipulation. The system often creates one large string in contiguous meinory from several smaller strings. You cannot waste memory and cannot set an upper bound on string length or the number of strings to combine. Write pseudocode for a method thai comibines strings, recovering memory that is no longer used b. A mutipass conpiler. Objects are created dynamically. Each pass examines the objects created on the previous pass and produces objects to be used on the next pass. The computer systern on which the compiler will run has a practically unlimited virtual address space and an operating system with a good swapping algorithm. The methods in the run-time library for allocating and deallocating memory dynamically are inefficient. Discuss the relative merits of two alternatives: (1) Forget about garbage collection and let the operating system allocate a large amount of virtual memory. (2) Recover deallocated objects with garbage col- lection c. Software that runs for a long time, such as banking software or an air traffic control system. You have the same computer system and run-time library as described in Exercise 18.7(b). Discuss the relative merits of the two approaches d. A method which may create and return an object that uses a large block of memory Discuss the relative merits of the following two approaches: (1) Each time the method is calle d, it destroys the object created the last time it was called, if any. (2) Each time the meth- od is called, it may create a new object. It is up to the calling method to destroy the object when it is no longer needed. Comment on these two approaches
Step by Step Solution
There are 3 Steps involved in it
To address these problems lets discuss memory management strategies without automatic garbage collection for each scenario a System for Text Manipulat... View full answer
Get step-by-step solutions from verified subject matter experts
