Skip to main content

Heap Garbage Collection in XSB: Practice and Experience

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2000)

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

Included in the following conference series:

Abstract

Starting from a theoretical understanding of the usefulness logic of a logic programming system with built-in tabling, and from a collector that did not take the characteristics of a tabled abstract machine into account we have build two heap garbage collectors (one mark&slide, one mark&copy) for XSB on top of the CHAT implementation model for the suspension/resumption of consumers. Based on this experience we discuss implementation issues that are general to heap garbage collection for the WAM and also issues that are specific to an implementation with tabling: as such, this paper documents our own implementation and can serve as guidance for anyone attempting a similar feat. We report on the behaviour of the garbage collectors on different kinds of programs. We also present figures on the extent of internal fragmentation and the effectiveness of early reset in Prolog systems with and without tabling.

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

    Article  Google Scholar 

  2. Y. Bekkers, O. Ridoux, and L. Ungaro. Dynamic memory management for sequential logic programming languages. In IWMM’92: International Workshop on Memory Management, number 637 in LNCS, pages 82–102, Sept. 1992. Springer.

    Google Scholar 

  3. J. Bevemyr and T. Lindgren. A simple and efficient copying garbage collector for prolog. In M. Hermenegildo and J. Penjam, editors, Proceedings of the 6th PLILP, number 844 in LNCS, pages 88–101, Madrid, Spain, Sept. 1994. Springer-Verlag.

    Google Scholar 

  4. M. Carlsson. Design and Implementation of an Or-Parallel Prolog Engine. PhD thesis, The Royal Institute of Technology (KTH), Stokholm, Sweden, Mar. 1990.

    Google Scholar 

  5. C. J. Cheney. A nonrecursive list compacting algorithm. Communications of the ACM, 13(11):677–678, Nov. 1970.

    Article  MATH  Google Scholar 

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

    Google Scholar 

  7. B. Demoen and K. Sagonas. CAT: the Copying Approach to Tabling. In C. Palamidessi, H. Glaser, and K. Meinke, editors, Principles of Declarative Programming, number 1490 in LNCS, pages 21–35, Pisa, Italy, Sept. 1998. Springer.

    Chapter  Google Scholar 

  8. B. Demoen and K. Sagonas. Memory management for Prolog with tabling. In Proceedings of ISMM’98: ACM SIGPLAN International Symposium on Memory Management, pages 97–106, Vancouver, B.C., Canada, Oct. 1998. ACM Press.

    Google Scholar 

  9. B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In G. Gupta, editor, Practical Aspects of Declarative Languages (PADL), number 1551 in LNCS, pages 106–121, San Antonio, Texas, Jan. 1999. Springer.

    Chapter  Google Scholar 

  10. M. S. Johnstone and P. R. Wilson. The memory fragmentation problem: Solved? In Proceedings of ISMM’98: ACM SIGPLAN International Symposium on Memory Management, pages 26–36, Vancouver, B.C., Canada, Oct. 1998. ACM Press.

    Google Scholar 

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

    Article  MATH  Google Scholar 

  12. E. Pittomvils, M. Bruynooghe, and Y. D. Willems. Towards a real time garbage collector for Prolog. In Proceedings of Symp. on Logic Progr., pages 185–198, 1985.

    Google Scholar 

  13. I. V. Ramakrishnan, P. Rao, K. Sagonas, T. Swift, and D. S. Warren. Efficient access mechanisms for tabled logic programs. J. of Logic Progr., 38(1):31–54, 1999.

    Article  MATH  Google Scholar 

  14. K. Sagonas and T. Swift. An abstract machine for tabled execution of fixed-order stratified logic programs. ACM Trans. Prog. Lang. Syst., 20(3):586–634, May 1998.

    Article  Google Scholar 

  15. K. Sagonas, T. Swift, and D. S. Warren. An abstract machine for computing the well-founded semantics. In Proceedings of JICSLP’96, pages 274–288, Sept. 1996.

    Google Scholar 

  16. P.M. Sansom. Combining copying and compacting garbage collection or Dual-mode garbage collection. In Functional Programming, Glasgow, Aug. 1991. Springer.

    Google Scholar 

  17. J. Schimpf. Garbage collection for Prolog based on twin cells. In Proceedings of the 1990 NACLP Implementation Workshop, pages 16–25, Austin, Texas, 1990.

    Google Scholar 

  18. H. Touati and T. Hama. A light-weight Prolog garbage collector. In Proceedings of FGCS’88, pages 922–930, Tokyo, Japan, Nov./Dec. 1988. OHMSHA and Springer.

    Google Scholar 

  19. D. H. D. Warren. An abstract Prolog instruction set. Technical Report 309, SRI International, Menlo Park, U.S.A., Oct. 1983.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Demoen, B., Sagonas, K. (1999). Heap Garbage Collection in XSB: Practice and Experience. In: Pontelli, E., Santos Costa, V. (eds) Practical Aspects of Declarative Languages. PADL 2000. Lecture Notes in Computer Science, vol 1753. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46584-7_7

Download citation

  • DOI: https://doi.org/10.1007/3-540-46584-7_7

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66992-0

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics