skip to main content
10.1145/1029873.1029885acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
Article

Experiments on the effectiveness of an automatic insertion of memory reuses into ML-like programs

Published:24 October 2004Publication History

ABSTRACT

We present extensive experimental results on our static analysis and source-level transformation [12, 11] that adds explicit memory-reuse commands into ML program text.

Our analysis and transformation cost is negligible (1,582 to 29,000 lines per seconds) enough to be used in daily programming. The payoff is the reduction of memory peaks and the total garbage collection time. The transformed programs reuse 3.4% to 93.9% of total allocated memory cells, and the memory peak is reduced by 0.0% to 71.9%. When the memory peak reduction is large enough to overcome the costs of dynamic flags and the memory reuse in the generational garbage collection, it speeds up program's execution by up to 39.1%. Otherwise, our transformation can slowdown programs by up to 7.3%. The speedup is likely only when the portion of garbage collection time among the total execution time is more than about 30%.

References

  1. David Aspinall and Martin Hofmann. Another type system for in-place update. In Proceedings of the European Symposium on Programming, volume 2305 of Lecture Notes in Computer Science, pages 36--52, April 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Erik Barendsen and Sjaak Smetsers. Uniqueness typing for functional languages with graph rewriting semantics. Mathematical Structures in Computer Science, 6:579--612, 1995.]]Google ScholarGoogle ScholarCross RefCross Ref
  3. Bruno Blanchet. Escape analysis: Correctness proof, implementation and experimental results. In Proceedings of The ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 25--37, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Karl Crary, David Walker, and Greg Morrisett. Typed memory management in a calculus of capabilities. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 262--275, January 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. David Gay and Alex Aiken. Language support for regions. In Proceedings of the ACM Conference on Programming Language Design and Implementation, pages 70--80, June 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Ovidiu Gheorghioiu, Alexandru Sǎlcianu, and Martin Rinard. Interprocedural compatibility analysis for static object preallocation. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 273--284, January 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Dan Grossman, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling Wang, and James Cheney. Region-based memory management in Cyclone. In Proceedings of the ACM Conference on Programming Language Design and Implementation, June 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Williams L. Harrison III. The interprocedural analysis and automatic parallelization of scheme programs. Lisp and Symbolic Computation, 2(3/4):179--396, 1989.]]Google ScholarGoogle Scholar
  9. Samin Ishtiaq and Peter O'Hearn. BI as an assertion language for mutable data structures. In Proceedings of the ACM Symposium on Principles of Programming Languages, January 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Naoki Kobayashi. Quasi-linear types. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 29--42, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Oukseh Lee, Hongseok Yang, and Kwangkeun Yi. Correctness proof on an algorithm to insert safe memory reuse commands. Technical Memorandum ROPAS-2003-19, Research On Program Analysis System, Seoul National University, November 2003. http://ropas.snu.ac.kr/memo.]]Google ScholarGoogle Scholar
  12. Oukseh Lee, Hongseok Yang, and Kwangkeun Yi. Inserting safe memory reuse commands into ml-like programs. In Proceedings of the Annual International Static Analysis Symposium, volume 2694 of Lecture Notes in Computer Science, pages 171--188, San Diego, California, June 2003. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Xavier Leroy, Damien Doligez, Jacques Garrigue, Didier Rémy, and Jérôme Vouillon. The Objective Caml system release 3.06. Institut National de Recherche en Informatique et en Automatique, August 2002. http://caml.inria.fr.]]Google ScholarGoogle Scholar
  14. Yosuhiko Minamide, Greg Morrisett, and Robert Harper. Typed closure conversion. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 271--283, January 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Mohnen. Efficient compile-time garbage collection for arbitrary data structures. In Proceedings of Programming Languages: Implementations, Logics and Programs, number 982 in Lecture Notes in Computer Science, pages 241--258. Springer--Verlag, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. nML programming language system, version 0.92b. Research On Program Analysis System, Seoul National University, April 2004. http://ropas.snu.ac.kr/n.]]Google ScholarGoogle Scholar
  17. Peter O'Hearn, John C. Reynolds, and Hongseok Yang. Local reasoning about programs that alter data structures. In The Proceedings of Computer Science and Logic, pages 1--19, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. John C. Reynolds. Separation logic: A logic for shared mutable data structures. In Proceedings of the Seventeenth Annual IEEE Symposium on Logic in Computer Science, July 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Frederick Smith, David Walker, and Greg Morrisett. Alias types. In Proceedings of the European Symposium on Programming, volume 1782 of Lecture Notes in Computer Science, pages 366--382, March/April 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. The Standard ML of New Jersey, version 110.0.7. Bell Laboratories, Lucent Technologies, October 2000. http://cm.bell-labs.com/cm/cs/what/smlnj.]]Google ScholarGoogle Scholar
  21. Mads Tofte and Lars Birkedal. A region inference algorithm. ACM Transactions on Programming Languages and Systems, 20(4):734--767, July 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Mads Tofte, Lars Birkedal, Martin Elsman, Niels Hallenberg, Tommy Højfeld Olesen, and Peter Sestoft. Programming with regions in the ML Kit (for version 4). IT University of Copenhagen, April 2002. http://www.it-c.dk/research/mlkit.]]Google ScholarGoogle Scholar
  23. Mads Tofte and Jean-Pierre Talpin. Implementation of the typed call-by-value λ-calculus using a stack of regions. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 188--201, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Mads Tofte and Jean-Pierre Talpin. Region-based memory management. Information and Computation, 132(2):109--176, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. David N. Turner, Philip Wadler, and Christian Mossin. Once upon a type. In International Conference on Functional Programming and Computer Architecture, pages 25--28, June 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Philip Wadler. Linear types can change the world! In M. Broy and C. Jones, editors, Programming Concepts and Methods, Sea of Galilee, Israel, April 1990. North Holland.]]Google ScholarGoogle Scholar
  27. David Walker and Greg Morrisett. Alias types for recursive data structures. In Workshop on Types in Compilation, volume 2071 of Lecture Notes in Computer Science, pages 177--206, September 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Experiments on the effectiveness of an automatic insertion of memory reuses into ML-like programs

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          ISMM '04: Proceedings of the 4th international symposium on Memory management
          October 2004
          182 pages
          ISBN:1581139454
          DOI:10.1145/1029873

          Copyright © 2004 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 24 October 2004

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          Overall Acceptance Rate72of156submissions,46%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader