Abstract
We show how to implement efficient copying garbage collection for Prolog. We measure the efficiency of the collector compared to a standard mark-sweep algorithm on several programs. We then show how to accomodate generational garbage collection and Prolog primitives that make the implementation more difficult.
The resulting algorithms are simpler and more efficient than the standard mark-sweep method on a range of benchmarks. The total execution times of the benchmark programs are reduced by 4 to 11 percent.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
K. Appleby, M. Carlsson, S. Haridi, and D. Sahlin, Garbage Collection for Prolog Based on WAM, Communications of the ACM, 31(6):719–741, June 1988.
A.W. Appel, A runtime system, Lisp and Symbolic Computation, 3(4), 1990.
A.W. Appel, Simple generational garbage collection and fast allocation, Software—Practice and Expenence,19(2):171–183, 1989.
J. Barklund, H. Millroth, Garbage cut for garbage collection of iterative Prolog programs, 3rd Symposium on Logic Programming, Salt Lake City, September 1986, IEEE.
Y. Bekkers, O. Ridoux and L. Ungaro, Dynamic Memory Management for Sequential Logic Programming Languages, Proceedings of the International Workshop on Memory Management 92, LNCS 637, Springer-Verlag, Berlin, 1992.
C.J. Cheney, A nonrecursive list compacting algorithm, Communications of the ACM, 13(11):677–678, November 1970.
J. Cohen, Garbage Collection of Linked Data Structure, Computing Surveys, 13(3):341–367, September 1981.
H. Lieberman, C. Hewitt, A real-time garbage collector based on the lifetimes of objects, Communications of the ACM, 26(6):419–429, June 1983.
F. Morris, A Time-and Space-Efficient Compaction Algorithm, Communications of the ACM, 12(9):662–665, August 1978.
W.J. Older and J.A. Rummell, An Incremental Garbage Collector for WAM-Based Prolog, Proceedings of the Joint International Conference and Symposium on Logic Programming, MIT Press, Cambridge, Mass., 1992.
D. Sahlin, Making garbage collection independent of the amount of garbage, Research Report R87008, Swedish Institute of Computer Science, 1987.
H. Schorr and W.M. Waite, An Efficient Machine-Independent Procedure for Garbage Collection in Various List Structures, Communications of the ACM, 10(8):501–506, August 1967.
H. Touati, T. Hama, A light-weight prolog garbage collector, Proceedings of the International Conference on Fifth Generation Computing Systems, 1988.
D.H.D. Warren, An Abstract Prolog Instruction Set, SRI Tech. Note 309, SRI International, Menlo Park, Calif., USA, 1983.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bevemyr, J., Lindgren, T. (1994). A simple and efficient copying garbage collector for prolog. In: Hermenegildo, M., Penjam, J. (eds) Programming Language Implementation and Logic Programming. PLILP 1994. Lecture Notes in Computer Science, vol 844. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58402-1_8
Download citation
DOI: https://doi.org/10.1007/3-540-58402-1_8
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58402-5
Online ISBN: 978-3-540-48695-4
eBook Packages: Springer Book Archive