Abstract
A critical issue in the design of logic programming systems is their memory performance, both in terms of total memory usage and locality in memory accesses. BEAM, as most modern Prolog systems, requires both good emulator design and good memory performance for best performance. We report on a detailed study of the memory management techniques used on our sequential implementation of the EAM. We address questions like how effective are the techniques the BEAM uses to recover and reuse memory space, how garbage collection affects performance and how to classify and unify variables in a EAM environment. We also propose a finer variable allocation scheme to reduce memory overheads that is quite effective at reducing memory pressure, with only a small overhead.
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
Ali, K.A.M.: A Simple Generational Real-Time Garbage Collection Scheme. New Generation Computing 16(2), 201–221 (1998)
Appleby, K., Carlsson, M., Haridi, S., Sahlin, D.: Garbage collection for Prolog based on WAM. Communications of the ACM 31(6), 171–183 (1989)
Bevemyr, J., Lindgren, T.: PLILP 1994. LNCS, vol. 844, pp. 88–101. Springer, Heidelberg (1994)
Castro, L.F., Santos Costa, V.: Understanding Memory Management in Prolog Systems. In: Codognet, P. (ed.) ICLP 2001. LNCS, vol. 2237, p. 11. Springer, Heidelberg (2001)
Demoen, B., Nguyen, P.: So Many WAM Variations, So Little Time. In: Palamidessi, C., Moniz Pereira, L., Lloyd, J.W., Dahl, V., Furbach, U., Kerber, M., Lau, K.-K., Sagiv, Y., Stuckey, P.J. (eds.) CL 2000. LNCS (LNAI), vol. 1861, pp. 1240–1254. Springer, Heidelberg (2000)
Detlefs, D., Dosser, A., Zorn, B.: Memory allocation costs in large C and C++ programs. Software, Practice and Experience 24(6) (1994)
Gupta, G., Warren, D.H.D.: An Interpreter for the Extended Andorra Model. Technical report, Dep. of Computer Science, University of Bristol (November 1991)
Jaffar, J., Maher, M.: Constraint Logic Programming: a Survey. The Journal of Logic Programming 19/20 (May/July 1994)
Jones, R., Lins, R.: Garbage Collection: Algorithms for Automatic Dynamic Memory Management. John Wiley and Sons, Chichester (1996) (reprinted February 1997)
Lopes, R.: An Implementation of the Extended Andorra Model. PhD thesis, Universidade do Porto (December 2001)
Lopes, R., Castro, L., Costa, V.: From Simulation to Pratice: Cache Performance Study of a Prolog Systems. ACM SIGPLAN Notices 38(2), 56–64 (2003)
Lopes, R., Costa, V.S., Silva, F.: A novel implementation of the extended Andorra model. In: Ramakrishnan, I.V. (ed.) PADL 2001. LNCS, vol. 1990, pp. 199–213. Springer, Heidelberg (2001)
Lopes, R., Costa, V.S., Silva, F.: On deterministic computations in the extended andorra model. In: Palamidessi, C. (ed.) ICLP 2003. LNCS, vol. 2916, pp. 407–421. Springer, Heidelberg (2003)
Lopes, R., Santos Costa, V., Silva, F.: Prunning in the extended andorra model. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 120–134. Springer, Heidelberg (2004)
Ozawa, T., Hosoi, A., Hattori, A.: Generation Type Garbage Collection for Parallel Logic Languages. In: Proceedings of the North American Conference on Logic Programming, pp. 291–305. MIT Press, Cambridge (1990)
Santos Costa, V.: Optimising bytecode emulation for prolog. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 261–267. Springer, Heidelberg (1999)
Shapiro, E.: The family of Concurrent Logic Programming Languages. ACM computing surveys 21(3), 412–510 (1989)
Warren, D.H.D.: An Abstract Prolog Instruction Set. Technical Note 309, SRI International (1983)
Warren, D.H.D.: The Extended Andorra Model with Implicit Control. Presented at ICLP 1990 Workshop on Parallel Logic Programming, Eilat, Israel (June 1990)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Lopes, R., Costa, V.S. (2005). Improving Memory Usage in the BEAM. In: Hermenegildo, M.V., Cabeza, D. (eds) Practical Aspects of Declarative Languages. PADL 2005. Lecture Notes in Computer Science, vol 3350. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30557-6_12
Download citation
DOI: https://doi.org/10.1007/978-3-540-30557-6_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-24362-5
Online ISBN: 978-3-540-30557-6
eBook Packages: Computer ScienceComputer Science (R0)