Many heap-oriented languages such as Lisp and Id depend on run-time garbage collection to reclaim storage. Garbage collection can be a significant run-time expense, especially for functional languages that tend to allocate structures often. Compiler-directed storage reclamation reduces the run-time overhead of garbage collection by having the compiler insert deallocation code. Compilers must perform object lifetime analysis in order to insert storage reclamation code. Current approaches to lifetime analysis assume a strict or sequential interpreter.
We formulate an operational semantics for a parallel, non-strict language in order to precisely define when it is safe to deallocate an object. Our operational semantics yields exact information about what objects are allocated, deallocated, and referenced at any point during the execution of a program. Using this information, we define precise run-time conditions that must be met by safe deallocation commands.
We use abstract interpretation to yield at compile-time a summary of what objects are allocated and reachable at any point in a program. We define static conditions that must be met by safe deallocation commands. We then define an algorithm that uses the abstract interpreter to verify the safety of deallocation commands already in programs and an algorithm to insert safe deallocation commands into programs.
We describe our implementation of the lifetime analysis, the verification algorithm, and the insertion algorithm. We then discuss the effectiveness of the compiler at verifying and inserting deallocation commands in several medium-sized Id programs. We also discuss the performance of each program in terms of storage allocated and reclaimed. Our implementation is quite effective for programs with simple patterns of sharing between objects. (Copies available exclusively from MIT Libraries, Rm. 14-0551, Cambridge, MA 02139-4307. Ph. 617-253-5668; Fax 617-253-1690.)
Recommendations
Just-in-time compiler assisted object reclamation and space reuse
NPC'10: Proceedings of the 2010 IFIP international conference on Network and parallel computingGarbage collection consumes significant overhead to reclaim memory used by dead (i.e., unreachable) objects in applications. This paper explores techniques for compiler assisted object reclamation and allocation on an actual JVM. Thereinto, the just-in-...