Skip to main content

Garbage Collection Algorithms for Java-Based Prolog Engines

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

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

Included in the following conference series:

Abstract

Implementing a Prolog Runtime System in a language like Java, which provides its own automated memory management and safety features (like built-in index checking and array initialization) requires a consistent approach to memory management based on a simple ultimate goal: minimizing total memory management time (the sum of Java’s own and ours). Based on our experience with Jinni 2002 - a Java based compiled Prolog system, we analyze the existing garbage collection algorithms and propose new optimizations. In particular, we aim to have a garbage collector with least extra helper memory space yet with reasonably fast speed. Efforts are made in reducing both time and space overhead for the mark-sweep-compact algorithm. We suggest an in-place compaction algorithm and provide its implementation. As the Prolog engine uses dynamic arrays for its stacks, the impact of Java’s garbage collector on the system becomes a key factor. In this context, we measure and optimize the performance of the garbage collector with the overall memory management scheme in mind.

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. Sterling, Leon, Ehud Shapiro. “The Art of Prolog.” The MIT Press. 1999.

    Google Scholar 

  2. Appleby, Karen, Mats Carlsson, Seif Haridi, Dan Sahlin. “Garbage Collection for Prolog Based on WAM.” Communications of the ACM. 31(6):719–741, 1998.

    Article  Google Scholar 

  3. Demoen, Bart, Geert Engels, Paul Tarau. “Segment Order Preserving Copying Garbage Collection for WAM Based Prolog.” Proceedings of the 1996 ACM Symposium on Applied Computing. 380–386,1996.

    Google Scholar 

  4. Zorn, Benjamin. “Comparing mark-and-sweep and Stop-and-copy Garbage Collection.” Communications of ACM 1990

    Google Scholar 

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

    Article  MATH  Google Scholar 

  6. McCarthy, John. “Recursive functions for symbolic expressions and their computations by machine, part I.” Communications of the ACM 3(4) 184–195, 1960

    Article  MATH  MathSciNet  Google Scholar 

  7. Wilson, Paul. “Uniprocessor Garbage Collection Techniques.” Proceedings of the 1992 International Workshop on Memory Management. 1992.

    Google Scholar 

  8. Appel, Andrew. “Simple Generational Garbage Collection and Fast Allocation.” Software-Practice and Experience. 19(2) 171–183, 1989.

    Article  MathSciNet  Google Scholar 

  9. Cohen, Jacques. “Garbage Collection of Linked Data Structure.” Computing Surveys 13(3) 341–367, 1981.

    Article  MathSciNet  Google Scholar 

  10. Bevemyr, Johan, Thomas Lindgren. “A Simple and Efficient Copying Garbage Collector for Prolog.” Lecture Notes on Computer Science 1994.

    Google Scholar 

  11. Lieberman, Henry, Carl Hewitt. “A real-time garbage collector based on the lifetimes of objects.” Communications of the ACM 26(6): 419–429, 1983

    Article  Google Scholar 

  12. Greenblatt, Richard. “The LISP machine.” Interactive Programming Environments McCraw Hill, 1984.

    Google Scholar 

  13. Courts, Robert. “Improving locality of reference in a garbage-collecting memory management system.” Communications of the ACM 31(9):1128–1138. 1988

    Article  Google Scholar 

  14. Ungar, David. “Generation scavenging: A non-disruptive high-performance storage reclamation algorithm.” ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments 157–167, 1984.

    Google Scholar 

  15. Ungar, David, Frank Jackson. “Tenuring policies for generation-based storage reclamation.” ACM SIGPLAN Conference on Object Oriented Programming System, Languages and Application 1988

    Google Scholar 

  16. Ait-Kaci, H. “Warren’s Abstract Machine: A tutorial Reconstruction.” The MIT Press 1999

    Google Scholar 

  17. Sahlin, Dan, Y.C. Chung, S.M. Moon, K. Ebcioglu. “Reducing sweep time for a nearly empty heap.” Symposium on Principles of Programming Languages 378–389, 2000

    Google Scholar 

  18. Morris, F.Lockwood. “A Time-and Space-Efficient Garbage Compaction Algorithm” Communications of the ACM 21(8):662–665. 1978

    Article  MATH  Google Scholar 

  19. Tarau, Paul. “ Inference and Computation Mobility with Jinni.” The Logic Programming Paradigm: a 25 Year Perspective 33–48, 1999

    Google Scholar 

  20. Tarau, Paul, Veronica Dahl. “High-Level Networking with Mobile Code and First Order AND-Continuations.” Theory and Practice of Logic Programming 1(1), March 2001. Cambridge University Press.

    Google Scholar 

  21. Tyagi, Satyam, Paul Tarau. “Multicast Protocols for Jinni Agents.” Proceedings of CL2000 Workshop on Parallelism and Implementation Technology for (Constraint) Logic Programming London, UK, June 2000.

    Google Scholar 

  22. Tarau, Paul. “Intelligent Mobile Agent Programming at the Intersection of Java and Prolog.” Proceedings of The Fourth International Conference on The Practical Application of Intelligent Agents and Multi-Agents 109–123, London, U.K., 1999.

    Google Scholar 

  23. Tarau, Paul, Ulrich Neumerkel. “A Novel Term Compression Scheme and Data Representation in the BinWAM.” Proceedings of Programming Language Implementation and Logic Programming, Lecture Notes in Computer Science 844, 73–87. September 1994.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Zhou, Q., Tarau, P. (2003). Garbage Collection Algorithms for Java-Based Prolog Engines. In: Dahl, V., Wadler, P. (eds) Practical Aspects of Declarative Languages. PADL 2003. Lecture Notes in Computer Science, vol 2562. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36388-2_21

Download citation

  • DOI: https://doi.org/10.1007/3-540-36388-2_21

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-00389-2

  • Online ISBN: 978-3-540-36388-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics