 Data Structures and Algorithms 
with Object-Oriented Design Patterns in Java
Data Structures and Algorithms 
with Object-Oriented Design Patterns in Java
 
  
  
  
  
 
-  
	Let M be the size of the heap
	and let f be the fraction of the heap occupied by live data.
	Estimate the running time of the mark method
	of the mark-and-sweep garbage collection scheme
	as a function of f and M.
-  
	Repeat Exercise  for the copy method
	Estimate the running time of the copy method
	of the stop-and-copy garbage collection scheme. for the copy method
	Estimate the running time of the copy method
	of the stop-and-copy garbage collection scheme.
-  
	Repeat Exercise  for the copy method
	Estimate the running time of the compact method
	of the stop-and-compact garbage collection scheme. for the copy method
	Estimate the running time of the compact method
	of the stop-and-compact garbage collection scheme.
- 
	Using your answers to
	Exercises  , , and and ,
	show that running time of garbage collection
	is inversely proportional to the about of storage recovered. ,
	show that running time of garbage collection
	is inversely proportional to the about of storage recovered.
- 
	The efficiency of a garbage collection scheme is
	the rate at which memory is reclaimed.
	Using your answers to Exercises  and and compare the efficiency of mark-and-sweep
	with that of stop-and-copy. compare the efficiency of mark-and-sweep
	with that of stop-and-copy.
-  
	Devise a non-recursive algorithm
	for the mark method
	of the mark-and-sweep garbage collection scheme.
- 
	Repeat Exercise  for the copy method
	of the stop-and-copy garbage collection scheme. for the copy method
	of the stop-and-copy garbage collection scheme.
- 
	Repeat Exercise  for the mark method
	of the mark-and-compact garbage collection scheme. for the mark method
	of the mark-and-compact garbage collection scheme.
- 
	Consider the use of handles for representing object references.
	Is it correct to assume that the order which objects appear in the heap
	is the same as the order in which the corresponding handles
	appear in the array of handles?
	How does this affect compaction of the heap?
- 
	Consider the compact method of the mark-and-compact
	garbage collection scheme.
	The algorithm visits the objects in the heap in the order
	in which they appear in the heap,
	rather than in the order in which the corresponding handles appear
	in the array of handles.
	Why is this necessary?
- 
	The compact method of the mark-and-compact
	garbage collection scheme slides the objects in the heap
	all to one end, but leaves the handles where they are.
	As a result, the handle array becomes fragmented.
	What modifications are necessary in order to compact
	the handle array as well as the heap?
 
  
  
  
  
 
 Copyright © 1998 by Bruno R. Preiss, P.Eng.  All rights reserved.
Copyright © 1998 by Bruno R. Preiss, P.Eng.  All rights reserved.