Design patterns in garbage collection
Thesis DisciplineComputer Science
Degree GrantorUniversity of Canterbury
Degree NameMaster of Science
This thesis presents an examination of design patterns within the context of garbage collection. Initially, I review garbage collection and design patterns. Four garbage collectors are then examined and the design patterns found described. Both domain specific and generic patterns are described. The domain specific patterns are TriColour and RootSet, the generic patterns are Adaptor, Facade, Iterator and Proxy. It is hoped that by, applying these patterns, systems designers have access to a less efficient, but simpler and more flexible way of implementing and reusing garbage collectors in programming languages. The requirements analysis for a garbage collector for a real-time object-oriented micro-kernel is then performed, and a design prepared using the design patterns found in the other garbage collectors. The garbage collector is then implemented in Java using appropriate data structures. Due to timing difficulties in the runtime environment, timing was ruled out as a method of performance analysis. Algorithmic analysis is performed to evaluate the worst-case performance of the collector, which is found to be satisfactory in all but one method of the RootSet implementation. An approach to remedying this is suggested.