Advertisement

On the Effects of Integrating Region-Based Memory Management and Generational Garbage Collection in ML

  • Martin ElsmanEmail author
  • Niels Hallenberg
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 12007)

Abstract

We present a region-based memory management scheme with support for generational garbage collection. The scheme is implemented in the MLKit Standard ML compiler, which features a compile-time region inference algorithm. The compiler generates native x64 machine code and deploys region types at runtime to avoid write barrier problems and to support partly tag-free garbage collection. We measure the characteristics of the scheme, for a number of benchmarks, and compare it to the Mlton state-of-the-art Standard ML compiler and configurations of the MLKit with and without region inference and generational garbage collection enabled. Although region inference often serves the purpose of generations, we demonstrate that, in some cases, generational garbage collection combined with region inference is beneficial.

Keywords

Region inference Generational garbage collection 

References

  1. 1.
    Aiken, A., Fähndrich, M., Levien, R.: Better static memory management: improving region-based analysis of higher-order languages. In: ACM Conference on Programming Languages and Implementation, PLDI, June 1995Google Scholar
  2. 2.
    Aldrich, J., Kostadinov, V., Chambers, C.: Alias annotations for program understanding. In: ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA (2002)Google Scholar
  3. 3.
    Anderson, T.A.: Optimizations in a private nursery-based garbage collector. In: ACM International Symposium on Memory Management, ISMM (2010)Google Scholar
  4. 4.
    Birkedal, L., Tofte, M., Vejlstrup, M.: From region inference to von Neumann machines via region representation inference. In: ACM Symposium on Principles of Programming Languages, POPL, January 1996Google Scholar
  5. 5.
    Blanchet, B.: Escape analysis: correctness proof, implementation and experimental results. In: ACM Symposium on Principles of Programming Languages (POPL 1998), pp. 25–37. ACM Press, January 1998Google Scholar
  6. 6.
    Boyapati, C., Salcianu, A., Beebee Jr., W., Rinard, M.: Ownership types for safe region-based memory management in real-time Java. In: ACM Conference on Programming Language Design and Implementation, PLDI (2003)Google Scholar
  7. 7.
    Doligez, D., Leroy, X.: A concurrent, generational garbage collector for a multithreaded implementation of ML. In: ACM Symposium on Principles of Programming Languages, POPL (1993)Google Scholar
  8. 8.
    Elsman, M.: Garbage collection safety for region-based memory management. In: ACM Workshop on Types in Language Design and Implementation. TLDI, January 2003Google Scholar
  9. 9.
    Elsman, M., Hallenberg, N.: An optimizing backend for the ML Kit using a stack of regions. Student Project 95-7-8, University of Copenhagen (DIKU), 5 July 1995Google Scholar
  10. 10.
    Elsman, M., Hallenberg, N.: SMLserver–a functional approach to web publishing, 154 p. The IT University of Copenhagen (2002). http://www.smlserver.org
  11. 11.
    Elsman, M., Hallenberg, N.: Web programming with SMLserver. In: Dahl, V., Wadler, P. (eds.) PADL 2003. LNCS, vol. 2562, pp. 74–91. Springer, Heidelberg (2003).  https://doi.org/10.1007/3-540-36388-2_7CrossRefGoogle Scholar
  12. 12.
    Elsman, M., Hallenberg, N.: Combining region inference and generational garbage collection. Technical report 2019/01, Department of Computer Science, University of Copenhagen (DIKU), ISSN 0107–8283, November 2019Google Scholar
  13. 13.
    Elsman, M., Larsen, K.F.: Typing XHTML web applications in ML. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 224–238. Springer, Heidelberg (2004).  https://doi.org/10.1007/978-3-540-24836-1_16CrossRefGoogle Scholar
  14. 14.
    Elsman, M., Munksgaard, P., Larsen, K.F.: Experience report: type-safe multi-tier programming with Standard ML modules. In: Proceedings of the ML Family Workshop, ML, September 2018Google Scholar
  15. 15.
    Gay, D., Aiken, A.: Language support for regions. In: ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2001). ACM Press, Snowbird, June 2001Google Scholar
  16. 16.
    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), June 1996Google Scholar
  17. 17.
    Hallenberg, N., Elsman, M., Tofte, M.: Combining region inference and garbage collection. In: ACM Conference on Programming Language Design and Implementation (PLDI 2002). ACM Press, Berlin, June 2002Google Scholar
  18. 18.
    Huelsbergen, L., Winterbottom, P.: Very concurrent mark-&-sweep garbage collection without fine-grain synchronization. In: ACM International Symposium on Memory Management, ISMM (1998)Google Scholar
  19. 19.
    Jones, R., Hosking, A., Moss, E.: The Garbage Collection Handbook: The Art of Automatic Memory Management. Chapman & Hall/CRC, London (2011)CrossRefGoogle Scholar
  20. 20.
    Jost, S., Hammond, K., Loidl, H.W., Hofmann, M.: Static determination of quantitative resource usage for higher-order programs. In: ACM Symposium on Principles of Programming Languages, POPL (2010)Google Scholar
  21. 21.
    Marlow, S., Peyton Jones, S.: Multicore garbage collection with local heaps. In: ACM International Symposium on Memory Management, ISMM (2011)Google Scholar
  22. 22.
    Marlow, S., Peyton Jones, S., Singh, S.: Runtime support for multicore Haskell. In: ACM International Conference on Functional Programming, ICFP (2009)Google Scholar
  23. 23.
    Reppy, J.H.: A high-performance garbage collector for Standard ML. Technical report, AT&T Bell Laboratories, January 1994Google Scholar
  24. 24.
    Salagnac, G., Yovine, S., Garbervetsky, D.: Fast escape analysis for region-based memory management. Electron. Notes Theor. Comput. Sci. 131, 99–110 (2005)CrossRefGoogle Scholar
  25. 25.
    Salagnac, G., Nakhli, C., Rippert, C., Yovine, S.: Efficient region-based memory management for resource-limited real-time embedded systems. In: Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems, July 2006Google Scholar
  26. 26.
    Swamy, N., Hicks, M., Morrisett, G., Grossman, D., Jim, T.: Safe manual memory management in cyclone. Sci. Comput. Program. 62(2), 122–144 (2006)MathSciNetCrossRefGoogle Scholar
  27. 27.
    Tofte, M., Birkedal, L., Elsman, M., Hallenberg, N.: A retrospective on region-based memory management. Higher-Order Symb. Comput. 17(3), 245–265 (2004)CrossRefGoogle Scholar
  28. 28.
    Tofte, M., Birkedal, L., Elsman, M., Hallenberg, N., Olesen, T.H., Sestoft, P.: Programming with regions in the MLKit (revised for version 4.3.0). Technical report, IT University of Copenhagen, Denmark, January 2006Google Scholar
  29. 29.
    Ueno, K., Ohori, A.: A fully concurrent garbage collector for functional programs on multicore processors. In: ACM International Conference on Functional Programming, ICFP (2016)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2020

Authors and Affiliations

  1. 1.University of CopenhagenCopenhagenDenmark
  2. 2.SimCorp A/SCopenhagenDenmark

Personalised recommendations