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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Sterling, Leon, Ehud Shapiro. “The Art of Prolog.” The MIT Press. 1999.
Appleby, Karen, Mats Carlsson, Seif Haridi, Dan Sahlin. “Garbage Collection for Prolog Based on WAM.” Communications of the ACM. 31(6):719–741, 1998.
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.
Zorn, Benjamin. “Comparing mark-and-sweep and Stop-and-copy Garbage Collection.” Communications of ACM 1990
Cheney, C.J. “A nonrecursive list compacting algorithm.” Communications of the ACM 13(11) 677–678, 1970
McCarthy, John. “Recursive functions for symbolic expressions and their computations by machine, part I.” Communications of the ACM 3(4) 184–195, 1960
Wilson, Paul. “Uniprocessor Garbage Collection Techniques.” Proceedings of the 1992 International Workshop on Memory Management. 1992.
Appel, Andrew. “Simple Generational Garbage Collection and Fast Allocation.” Software-Practice and Experience. 19(2) 171–183, 1989.
Cohen, Jacques. “Garbage Collection of Linked Data Structure.” Computing Surveys 13(3) 341–367, 1981.
Bevemyr, Johan, Thomas Lindgren. “A Simple and Efficient Copying Garbage Collector for Prolog.” Lecture Notes on Computer Science 1994.
Lieberman, Henry, Carl Hewitt. “A real-time garbage collector based on the lifetimes of objects.” Communications of the ACM 26(6): 419–429, 1983
Greenblatt, Richard. “The LISP machine.” Interactive Programming Environments McCraw Hill, 1984.
Courts, Robert. “Improving locality of reference in a garbage-collecting memory management system.” Communications of the ACM 31(9):1128–1138. 1988
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.
Ungar, David, Frank Jackson. “Tenuring policies for generation-based storage reclamation.” ACM SIGPLAN Conference on Object Oriented Programming System, Languages and Application 1988
Ait-Kaci, H. “Warren’s Abstract Machine: A tutorial Reconstruction.” The MIT Press 1999
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
Morris, F.Lockwood. “A Time-and Space-Efficient Garbage Compaction Algorithm” Communications of the ACM 21(8):662–665. 1978
Tarau, Paul. “ Inference and Computation Mobility with Jinni.” The Logic Programming Paradigm: a 25 Year Perspective 33–48, 1999
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.
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.
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.
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.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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