Practical Aspects for a Working Compile Time Garbage Collection System for Mercury

Compile-time garbage collection (CTGC) is still a very uncommon feature within compilers. In previous work we have developed a compile-time structure reuse system for Mercury, a logic programming language. This system indicates which datastructures can safely be reused at run-time. As preliminary experiments were promising, we have continued this work and have now a working and well performing near-to-ship CTGC-system built into the Melbourne Mercury Compiler (MMC).In this paper we present the multiple design decisions leading to this system, we report the results of using CTGC for a set of benchmarks, including a real-world program, and finally we discuss further possible improvements. Benchmarks show substantial memory savings and a noticeable reduction in execution time.

[1]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[2]  Manuel V. Hermenegildo,et al.  Global Analysis of Standard Prolog Programs , 1996, ESOP.

[3]  Paul Tarau,et al.  Monadic Constructs for Logic Programming , 1995, ILPS.

[4]  Peter J. Stuckey,et al.  A model for inter-module analysis and optimizing compilation , 2000, LOPSTR.

[5]  Saumya K. Debray,et al.  A Practical Approach to Structure Reuse of Arrays in Single Assignment Languages , 1997, ICLP.

[6]  Gerda Janssens,et al.  Live-Structure Analysis for Logic Programming Languages with Declarations , 1997, ICLP.

[7]  Danny De Schreye Program Analysis, Debugging, and Optimization Using the Ciao System Preprocessor , 1999 .

[8]  Markus Mohnen,et al.  Optimising the memory management of higher order functional programs , 1997 .

[9]  David S. Warren On Copy Avoidance in Single Assignment Languages , 1993 .

[10]  Patrick Cousot,et al.  Comparing the Galois Connection and Widening/Narrowing Approaches to Abstract Interpretation , 1992, PLILP.

[11]  William H. Winsborough,et al.  Compile-time memory reuse in logic programming languages through update in place , 1999, TOPL.

[12]  Gerda Janssens,et al.  A Module Based Analysis for Memory Reuse in Mercury , 2000, Computational Logic.

[13]  David Jeffery,et al.  Run Time Type Information in Mercury , 1999, PPDP.

[14]  Peter J. Stuckey,et al.  An Overview of HAL , 1999, CP.

[15]  Mads Tofte,et al.  Region-based Memory Management , 1997, Inf. Comput..

[16]  Feliks Kluzniak,et al.  Compile Time Garbage Collection for Ground Prolog , 1988, ICLP/SLP.

[17]  Zoltan Somogyi,et al.  The Execution Algorithm of Mercury, an Efficient Purely Declarative Logic Programming Language , 1996, J. Log. Program..

[18]  Maurice Bruynooghe,et al.  Live-structure dataflow analysis for Prolog , 1994, TOPL.

[19]  Maurice Bruynooghe,et al.  A Practical Framework for the Abstract Interpretation of Logic Programs , 1991, J. Log. Program..