Skip to main content

A Different Look at Garbage Collection for the WAM

  • Conference paper
  • First Online:
Logic Programming (ICLP 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2401))

Included in the following conference series:

Abstract

A non-algorithmic approach to garbage collection for the WAM heap is developed. A set of garbage collections compatible with the WAM is specified in two steps: the first step makes the useful data for each continuation private and ensures that only useful terms survive garbage collection. The second step completes garbage collection by extending the intuitive notion of folding of identical structures. The role of the trail in the folding process is crucial and it is shown for the ordinary WAM trail as well as for a value trail. New and unexpected opportunities for recovering memory are discovered to be compatible with this view of garbage collection. This approach leads to better understanding of the usefulness logic in the WAM, it is a good start for the formal specification of the garbage collection process and it shows a potential for new compile time analyses that can improve run time memory management. Choice point trimming is used as a vehicle to show selective liveness of data, so its relation to the more common stack maps is established.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. H. Ait-Kaci. The WAM: a (real) tutorial. Technical Report 5, DEC Paris Research Report, 1990 See also: http://www.isg.sfu.ca/~hak/documents/wam.html.

  2. A. W. Appel and M. J. R. Goncalves. Hash-consing garbage collection. Technical Report CS-TR-412-93, Princeton University, Feb. 1993.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. Y. Bekkers, O. Ridoux, and L. Ungaro. Dynamic memory management for sequential logic programming languages. In Y. Bekkers and J. Cohen, editors, Proceedings of IWMM’92: International Workshop on Memory Management, number 637 in Lecture Notes in Computer Science, pages 82–102. Springer-Verlag, Sept. 1992.

    Google Scholar 

  5. J. Bevemyr and T. Lindgren. A simple and efficient copying garbage collector for Prolog. In M. Hermenegildo and J. Penjam, editors, Proceedings of the Sixth International Symposium on Programming Language Implementation and Logic Programming, number 844 in Lecture Notes in Computer Science, pages 88–101. Springer-Verlag, Sept. 1994.

    Google Scholar 

  6. L. F. Castro and V. S. Costa. Understanding Memory Management in Prolog Systems. In P. Codognet, editor, Proceedings of the 17th International Conference on Logic Programming, ICLP’2001, number 2237 in Lecture Notes in Computer Science, pages 11–26. Springer-Verlag, nov 2001.

    Google Scholar 

  7. B. Demoen. Early reset and reference counting improve variable shunting in the WAM. Report CW 298, Dept. of Comp. Sc., K. U. Leuven, Belgium, Aug. 2000.

    Google Scholar 

  8. B. Demoen. Marking in the presence of destructive assignment is suboptimal. Report CW 302, Dept. of Computer Science, K. U. Leuven, Belgium, Oct. 2000.

    Google Scholar 

  9. B. Demoen. Prolog and abduction 4 writing garbage collectors. In K.-K. Lau, editor, Pre-Proceedings of Tenth International Workshop on Logic-based Program Syntthesis and Transformation, 2000, pages 128–135. University of Manchester, 2000. Technical Report Series, Department of Computer Science, University of Manchester, ISSN 1361-6161. Report number UMCS-00-6-1.

    Google Scholar 

  10. B. Demoen. A fresh look at garbage collection for Prolog. Report CW 330, Dept. of Computer Science, K. U. Leuven, Belgium, Jan. 2002.

    Google Scholar 

  11. B. Demoen, G. Engels, and P. Tarau. Segment order preserving copying garbage collection for WAM based Prolog. In Proceedings of the 1996 ACM Symposium on Applied Computing, pages 380–386. ACM Press, Feb. 1996.

    Google Scholar 

  12. R. Jones and R. Lins. Garbage Collection: Algorithms for automatic memory management. John Wiley, 1996 See also http://www.cs.ukc.ac.uk/people/staff/rej/gcbook/gcbook.html.

  13. X. Li. Efficient memory management in a merged heap/stack Prolog machine. In Proceedings of the 2nd ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP’00), pages 245–256. ACM Press, 2000.

    Google Scholar 

  14. E. Lusk, R. Butler, et. al. The aurora or-parallel prolog system. New Generation Computing, 7(2,3):243–271, 1990.

    Article  Google Scholar 

  15. F. L. Morris. A time-and space-efficient garbage compaction algorithm. Communications of the ACM, 21(8):662–665, Aug. 1978.

    Google Scholar 

  16. J. Noyé. Elagage de contexte, retour arrière superficiel, modifications réversibles et autres: une étude approfondie de la WAM. PhD thesis, Universite de Rennes I, Nov. 1994.

    Google Scholar 

  17. K. Sagonas, T. Swift, and D. S. Warren. XSB as an efficient deductive database engine. In Proc. of SIGMOD 1994 Conference. ACM, 1994.

    Google Scholar 

  18. D. Sahlin and M. Carlsson. Variable Shunting for the WAM. Technical Report SICS/R-91/9107, SICS, 1991.

    Google Scholar 

  19. P. Tarau. Program transformations and wam-support for the compilation of definite metaprograms. In A. Voronkov, editor, Russian Conference on Logic Programming, number 592 in Lecture Notes in Artificial Intelligence, pages 462–473, Berlin, Heidelberg, 1992. Springer-Verlag.

    Google Scholar 

  20. D. H. D. Warren. An abstract Prolog instruction set. Tech. Report 309, SRI, 1983.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Demoen, B. (2002). A Different Look at Garbage Collection for the WAM. In: Stuckey, P.J. (eds) Logic Programming. ICLP 2002. Lecture Notes in Computer Science, vol 2401. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45619-8_13

Download citation

  • DOI: https://doi.org/10.1007/3-540-45619-8_13

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43930-1

  • Online ISBN: 978-3-540-45619-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics