Higher-Order and Symbolic Computation

, Volume 17, Issue 3, pp 245–265

A Retrospective on Region-Based Memory Management

  • Mads Tofte
  • Lars Birkedal
  • Martin Elsman
  • Niels Hallenberg
Open Access
Article

Abstract

We report on our experience with designing, implementing, proving correct, and evaluating a region-based memory management system.

dynamic storage management regions Standard ML 

References

  1. 1.
    Aditya, S., Flood, C.H., and Hicks, J.E. Garbage collection for strongly-typed languages using run-time type reconstruction. In LISP and Functional Programming, 1994, pp. 12-23.Google Scholar
  2. 2.
    Aiken, A., Fähndrich, M., and Levien, R. Better static memory management: Improving region-based analysis of higher-order languages. In ACM Conference on Programming Language Design and Implementation, 1995, pp. 174-185.Google Scholar
  3. 3.
    Appel, A.W. Garbage collection can be faster than stack allocation. IPL, 25(4) (1987) 275-279.Google Scholar
  4. 4.
    Appel, A.W. Runtime tags aren't necessary. Lisp and Symbolic Computation, 2 (1989) 153-162.Google Scholar
  5. 5.
    Banerjee, A., Heintze, N., and Riecke, J.G. Region analysis and the polymorphic lambda calculus. In Logic in Computer Science, 1999, pp. 88-97.Google Scholar
  6. 6.
    Birkedal, L., Rothwell, N., Tofte, M., and Turner, D.N. The ML Kit (Version 1). Technical Report DIKU-report 93/14, Department of Computer Science, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen, 1993.Google Scholar
  7. 7.
    Birkedal, L. and Tofte, M. A constraint-based region inference algorithm. Theoretical Computer Science, 258, (2001) 299-392.Google Scholar
  8. 8.
    Birkedal, L., Tofte, M., and Vejlstrup, M. From region inference to von Neumann machines via region representation inference. In ACM Symposium on Principles of Programming Languages, 1996, pp. 171-183.Google Scholar
  9. 9.
    Blanchet, B. Escape analysis: Correctness proof, implementation and experimental results. In ACM Symposium on Principles of Programming Languages, 1998, pp. 25-37.Google Scholar
  10. 10.
    Boyapati, C., Salcianu, A., Beebee, W., and Rinard, M. Ownership types for safe region-based memory management in real-time java. In ACM Conference on Programming Language Design and Implementation, 2003.Google Scholar
  11. 11.
    Calcagno, C. Stratified operational semantics for safety and correctness of the region calculus. In ACM Symposium on Principles of Programming Languages, 2001.Google Scholar
  12. 12.
    Calcagno, C., Helsen, S., and Thiemann, P. Syntactic type soundness results for the region calculus. Information and Computation, 173(2) (2002).Google Scholar
  13. 13.
    Cheney, C.J. A non-recursive list compacting algorithm. Communications of the ACM, 13(11) (1970) 677-678.Google Scholar
  14. 14.
    Christiansen, M.V. and Velschow, P. Region-based memory management in Java. Master's thesis, DIKU, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen, Denmark, 1998.Google Scholar
  15. 15.
    Crary, K., Walker, D., and Morrisett, G. Typed memory management in a calculus of capabilities. In ACM Symposium on Principles of Programming Languages, 1999, pp. 262-275.Google Scholar
  16. 16.
    Damas, L. and Milner, R. Principal type schemes for functional programs. In ACM Symposium on Principles of Programming Languages, 1982, pp. 207-212.Google Scholar
  17. 17.
    Elsman, M. Program modules, separate compilation, and intermodule optimisation. Ph.D. thesis, Department of Computer Science, University of Copenhagen, 1999.Google Scholar
  18. 18.
    Elsman, M. Static interpretation of modules. In ACM International Conference on Functional Programming, Paris, France, 1999, pp. 208-219.Google Scholar
  19. 19.
    Elsman, M. Garbage collection safety for region-based memory management. In ACM Workshop on Types in Language Design and Implementation, 2003.Google Scholar
  20. 20.
    Elsman, M. and Hallenberg, N. An optimizing backend for the ML Kit using a stack of regions. Student Project 95-7-8, Department of Computer Science, University of Copenhagen (DIKU), 1995.Google Scholar
  21. 21.
    Elsman, M. and Hallenberg, N. Web programming with SMLserver, In International Symposium on Practical Aspects of Declarative Languages, 2003.Google Scholar
  22. 22.
    Gay, D. and Aiken, A. Memory management with explicit regions. In ACM Conference on Programming Language Design and Implementation, 1998, pp. 313-323.Google Scholar
  23. 23.
    Gay, D. and Aiken, A. Language support for regions. In ACM Conference on Programming Language Design and Implementation, 2001, pp. 70-80.Google Scholar
  24. 24.
    Goldberg, B. Tag-free garbage collection for strongly typed programming languages. In ACM Conference on Programming Language Design and Implementation, 1991, pp. 165-176.Google Scholar
  25. 25.
    Goldberg, B. and Gloger, M. Polymorphic type reconstruction for garbage collection without tags. In LISP and Functional Programming, 1992, pp. 53-65.Google Scholar
  26. 26.
    Goldberg, B. and Park, Y.G. Higher order escape analysis: Optimizing stack allocation in functional program implementations. In Proceedings of the third European Symposium on Programming, LNCS-432, 1990, pp. 152-160.Google Scholar
  27. 27.
    Grossman, D., Morrisett, G., Jim, T., Hicks, M., Wang, Y., and Cheney, J. Region-based memory management in cyclone. In ACM Conference on Programming Language Design and Implementation, 2002.Google Scholar
  28. 28.
    Hallenberg, N. A region profiler for a standard ML compiler based on region inference. Student Project 96-5-7, Department of Computer Science, University of Copenhagen (DIKU), 1996.Google Scholar
  29. 29.
    Hallenberg, N. Combining garbage collection and region inference in the ML Kit. Master's thesis, Department of Computer Science, University of Copenhagen. Available via http://www.it-c.dk/research/mlkit, 1999.Google Scholar
  30. 30.
    Hallenberg, N., Elsman, M., and Tofte, M. Combining region inference and garbage collection. In ACM Conference on Programming Language Design and Implementation, 2002.Google Scholar
  31. 31.
    Helsen, S. and Thiemann, P. Syntactic type soundness for the region calculus. In Proceedings of the 4th International Workshop on Higher Order Operational Techniques in Semantics, Published in vol. 41(3) of the Electronic Notes in Theoretical Computer Science, 2000.Google Scholar
  32. 32.
    Henglein, F., Makholm, H., and Niss, H. A direct approach to control-flow sensitive region-based memory management. In ACM Conference on Principles and Practice of Declarative Programming, Montréal, Canada, 2001, pp. 175-186.Google Scholar
  33. 33.
    Hofmann, M. A type system for bounded space and functional in-place update. Nordic Journal of Computing, 7(4) (2000) 258-289.Google Scholar
  34. 34.
    Hofmann, M. and Jost, S. Static prediction of heap space usage for first-order functional programs. In ACM Symposium on Principles of Programming Languages (POPL'03), 2003, pp. 185-197.Google Scholar
  35. 35.
    Jim, T., Morrisett, G., Grossman, D., Hicks, M., Cheney, J., and Wang, Y. Cyclone: A safe dialect of C. In USENIX Annual Technical Conference, 2002.Google Scholar
  36. 36.
    Jones, R. and Lins, R. Garbage Collection, Wiley, 1996.Google Scholar
  37. 37.
    Jouvelot, P. and Gifford, D. Algebraic reconstruction of types and effects. In ACM Symposium on Principles of Programming Languages, 1991.Google Scholar
  38. 38.
    Lucassen, J. and Gifford, D. Polymorphic effect systems. In ACM Symposium on Principles of Programming Languages, 1988.Google Scholar
  39. 39.
    Lucassen, J.M. Types and effects, towards the integration of functional and imperative programming. Ph.D. thesis, MIT Laboratory for Computer Science, MIT/LCS/TR-408, 1987.Google Scholar
  40. 40.
    Makholm, H. A region-based memory manager for Prolog. In International Symposium on Memory Management (ISMM'2000), 2000, pp. 25-34.Google Scholar
  41. 41.
    Makholm, H. A language-independent framework for region inference. Ph.D. thesis, Department of Computer Science, University of Copenhagen, 2003.Google Scholar
  42. 42.
    Miller, J.S. and Rozas, G.J. Garbage collection is fast, but a stack is faster. Technical Report Memo 1462, MIT, Cambridge, Massachusetts, 1994.Google Scholar
  43. 43.
    Monnier, S., Saha, B., and Shao, Z. Principled scavenging. In ACM Conference on Programming Language Design and Implementation, 2001.Google Scholar
  44. 44.
    Niss, H. Regions are imperative: Unscoped regions and control-flow sensitive memory management. Ph.D. thesis, Department of Computer Science, University of Copenhagen (DIKU), 2002.Google Scholar
  45. 45.
    Ross, D.T. The AED free storage package. Communication of the ACM, 10(8) (1967) 481-492.Google Scholar
  46. 46.
    Runciman, C. and Wakeling, D. Heap profiling of lazy functional languages. Journal of Functional Programming, 3(2) (1993) 217-245.Google Scholar
  47. 47.
    Stein, L. and MacEachern, D. Writing Apache Modules with Perl and C, O'Reilly & Associates, 1999, ISBN 1-56592-567-X.Google Scholar
  48. 48.
    Talpin, J.-P. and Jouvelot, P. Polymorphic type, region and effect inference. Journal of Functional Programming, 2(3), 1992.Google Scholar
  49. 49.
    Talpin, J.-P. and Jouvelot, P. The type and effect discipline. Information and Computation, 111(2) (1994) 245-296. Extended abstract in Proceedings of the IEEE Conference on Logic in Computer Science (LICS'92), June 1992.Google Scholar
  50. 50.
    Tofte, M. and Birkedal, L. A region inference algorithm. ACM Transactions on Programming Languages and Systems, 20(4) (1998) 734-767. (plus 24 pages of electronic appendix).Google Scholar
  51. 51.
    Tofte, M. and Birkedal, L. Unification and polymorphism in region inference. In Proof, Language, and Interaction. Essays in Honour of Robin Milner, G. Plotkin, C. Stirling, and M. Tofte (Eds.), Foundations of Computing. Cambridge, Massachusetts: The MIT Press, 2000, pp. 389-425.Google Scholar
  52. 52.
    Tofte, M., Birkedal, L., Elsman, M., Hallenberg, N., Olesen, T., and Sestoft, P. Programming with regions in the ML Kit (for Version 4). The IT University of Copenhagen, 2002. Available via http://www.it-c. dk/research/mlkit.Google Scholar
  53. 53.
    Tofte, M., Birkedal, L., Elsman, M., Hallenberg, N., Olesen, T.H., Sestoft, P., and Bertelsen, P. Programming with regions in the ML Kit, Technical Report DIKU-TR-97/12, Department of Computer Science, University of Copenhagen, 1997. Available via http://www.it-c.dk/research/mlkit.Google Scholar
  54. 54.
    Tofte, M., Birkedal, L., Elsman, M., Hallenberg, N., Olesen, T.H., Sestoft, P., and Bertelsen, P. Programming with regions in the ML Kit (for Version 3). Technical Report DIKU-TR-98/25, Department of Computer Science, University of Copenhagen, 1998. Available via http://www.it-c.dk/research/mlkit.Google Scholar
  55. 55.
    Tofte, M. and Talpin, J.-P. Data region inference for polymorphic functional languages. Manuscript, 1992.Google Scholar
  56. 56.
    Tofte, M. and Talpin, J.-P. A theory of stack allocation in polymorphically typed languages. Technical Report DIKU-report 93/15, Department of Computer Science, University of Copenhagen, 1993.Google Scholar
  57. 57.
    Tofte, M. and Talpin, J.-P. Implementing the call-by-value lambda-calculus using a stack of regions. In ACM Symposium on Principles of Programming Languages, 1994, pp. 188-201.Google Scholar
  58. 58.
    Tofte, M. and Talpin, J.-P. Region-based memory management. Information and Computation, 132(2) (1997) 109-176.Google Scholar
  59. 59.
    Tolmach, A.P. Tag-free garbage collection using explicit type parameters. In LISP and Functional Programming, 1994, pp. 1-11.Google Scholar
  60. 60.
    Vejlstrup, M. Multiplicity inference. Master's thesis, Department of Computer Science, Univ. of Copenhagen, 1994, report 94-9-1.Google Scholar
  61. 61.
    Walker, D., Crary, K., and Morrisett, G. Typed memory management via static capabilities. ACM Transactions on Programming Languages and Systems (TOPLAS), 22(4) (2000) 701-771.Google Scholar
  62. 62.
    Walker, D. and Watkins, K. On regions and linear types. In ACM International Conference on Functional Programming, 2001, pp. 181-192.Google Scholar
  63. 63.
    Wang, D.C. and Appel, A.W. Type-preserving garbage collectors. In ACM Symposium on Principles of Programming Languages, 2001, pp. 166-178.Google Scholar
  64. 64.
    Wilson, P.R., Johnstone, M.S., Neely, M., and Boles, D. Dynamic storage allocation: A survey and critical review. In International Workshop on Memory Management, 1995.Google Scholar
  65. 65.
    Yates, B.N. A type-and-effect system for encapsulating memory in Java. Master's thesis, Department of Computer Science and Information Science, University of Oregon, 1999.Google Scholar
  66. 66.
    Zilio, S.D. and Gordon, A. Region analysis and a pi-calculus with groups. Journal of Functional Programming, 12(3) (2002) 229-292.Google Scholar

Copyright information

© Kluwer Academic Publishers 2004

Authors and Affiliations

  • Mads Tofte
    • 1
  • Lars Birkedal
    • 1
  • Martin Elsman
    • 1
  • Niels Hallenberg
    • 1
  1. 1.The IT University of CopenhagenDenmark

Personalised recommendations