Project: Understanding the Limits of Reachability-Based GC by Measuring Object Drag

Project: Understanding the Limits of Reachability-Based GC by Measuring Object Drag

Overview

Since its beginnings, garbage collection has been implemented in terms of the reachability of objects from some set of program roots. This is a conservative approach since while it is true that an unreachable object can never be used, it is not true that all reachable objects will be used. There have been many attempts to incorporate liveness into garbage collection – that is, to use a compiler to determine whether something will never be used in the future, based on the control flow of the program rather than the reachability of the data. Examples of this include the use of escape analysis by modern compilers for garbage collected languages, which identifies objects whose lifetimes do not escape the life of a given stack frame, and which can therefore be allocated on the stack (or better still, scalar-replaced with only the fields of the object that are actually used). Another example can be seen in a language like Rust that manages object liveness via static analysis (it does not use garbage collection, nor does it use explict memory management).

Shaham et al conducted an interesting study that measured what they called drag, which is the time between when an object is last used and when it is actually collected (or when it becomes unreachable). Unfortuantely that study was conducted a long time ago on very simple benchmarks.

This project will reproduce Shaham’s work in MMTk and will measure drag both in terms of when the object actually becomes unreachable (using aggressive techniques to collect very frequently), and when it becomes collected by a conventional garbage collector. Ideally this project will study both Java and JavaScript, shedding light on the differences between the different programming paradigms.

Themes

  • Garbage collection

Requirements

  • Coding There are many aspects to this large project and a given student’s focus will depend on their interest and expertise.

Project Length

Project Outputs

This project will produce a new analysis of the efficacy of reachability-based GC, with insights into cross-language behaviors.

References