In a strongly typed language like java all variables and


One of the attractive aspects of conservative garbage collection is its simplicity. We need not store detailed information on what global, local and heap variables are pointers. Rather, any word that might be a heap pointer is treated as if is a pointer. What criteria would you use to decide if a given word in memory is possibly a pointer? How would you adapt your answer to Exercise 13 to handle what appear to be pointers to data within a heap object?

Exercise 13

In a language like C or C++ (without unions), the marking phase of a marksweep garbage collector is complicated by the fact that pointers to active heap objects may reference data within an object rather than the object itself. For example, the sole pointer to an array may be to an internal element, or the sole pointer to a class object may be a pointer to one of the object's fields. How must your solution to Exercise 11 be modified if pointers to data within an object are allowed?

Exercise 11

In a strongly typed language like Java all variables and fields have a fixed type known at compile-time. What run-time data structures are needed in Java to implement the mark phase of a mark-sweep garbage collector in which all accessible ("live") heap objects are marked?

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: In a strongly typed language like java all variables and
Reference No:- TGS01487170

Expected delivery within 24 Hours