Abstract

We present a method, adapted to polymorphically typed functional languages, to detect and collect more garbage than existing GCs. It can be applied to strict or lazy higher order languages and to several garbage collection schemes. Our GC exploits the information on utility of arguments provided by polymorphic types of functions. It is able to detect garbage that is still referenced from the stack and may collect useless parts of otherwise useful data structures. We show how to partially collect shared data structures and to extend the type system to infer more precise information. We also present how this technique can plug several common forms of space leaks. 1 Introduction Functional programs tend to be inefficient in their use of store. They usually allocate impressive amount of memory space and spend a significant part of their time garbage collecting. Much work has been done on reducing the overhead of garbage collection. In particular, various sophisticated garbage collectors ...