Runtime support for region-based memory management in Mercury

  • Authors:
  • Quan Phan;Zoltan Somogyi;Gerda Janssens

  • Affiliations:
  • Katholieke Universiteit Leuven, Leuven, Belgium;The University of Melbourne, Melbourne, Australia;Katholieke Universiteit Leuven, Leuven, Belgium

  • Venue:
  • Proceedings of the 7th international symposium on Memory management
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Applying region-based memory management (RBMM) to logic programming languages poses a special challenge: backtracking can require regions removed during forward execution to be "resurrected", and any memory allocated during a computation that has been backtracked over must be recovered promptly, without waiting for the regions involved to come to the end of their life. In this paper, we describe how we implemented runtime support for RBMM in the logic programming language Mercury, whose specialized implementation of the language constructs involved in backtracking required equally specialized support. Our benchmark Mercury programs run about 25% faster on average with RBMM than with the usual Boehm garbage collector, and for some programs, RBMM achieves optimal memory consumption.