Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1542431.1542451acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
research-article

Parametric heap usage analysis for functional programs

Published: 19 June 2009 Publication History

Abstract

This paper presents an analysis that derives a formula describing the worst-case live heap space usage of programs in a functional language with automated memory management (garbage collection). First, the given program is automatically transformed into bound functions that describe upper bounds on the live heap space usage and other related space metrics in terms of the sizes of function arguments. The bound functions are simplified and rewritten to obtain recurrences, which are then solved to obtain the desired formulas characterizing the worst-case space usage. These recurrences may be difficult to solve due to uses of the maximum operator. We give methods to automatically solve categories of such recurrences. Our analysis determines and exploits monotonicity and monotonicity-like properties of bound functions to derive upper bounds on heap usage, without considering behaviors of the program that cannot lead to maximal space usage.

References

[1]
E. Albert, P. Arenas, S. Genaim, and G. Puebla. Automatic inference of upper bounds for recurrence relations in cost analysis. In Proc. 15th International Static Analysis Symposium (SAS 2008), pages 221--237, 2008.
[2]
E. Albert, S. Genaim, and M. Gómez-Zamalloa. Heap space analysis for java bytecode. In Proc. 6th International Symposium on Memory Management (ISMM 2007), pages 105--116, 2007.
[3]
E. Albert, S. Genaim, and M. Gómez-Zamalloa. Live heap space analysis for languages with garbage collection. In Proc. 7th International Symposium on Memory Management(ISMM '09), 2009.
[4]
D. Aspinall, S. Gilmore, M. Hofmann, D. Sannella, and I. Stark. Mobile resource guarantees for smart devices. In Proceedings of the International Workshop on Construction and Analysis of Safe, Secure and Interoperable Smart Devices (CASSIS), volume 3362 of LNCS, pages 1--26. Springer, 2005.
[5]
D. F. Bacon. Realtime garbage collection. Queue, 5(1):40--49, 2007.
[6]
R. Bagnara, A. Pescetti, A. Zaccagnini, E. Zaffanella, and T. Zolo. PURRS: The Parma University's recurrence relation solver. http: //www.cs.unipr.it/purrs.
[7]
G. Barthe, M. Pavlova, and G. Schneider. Precise analysis of memory consumption using program logics. In SEFM '05: Proceedings of the Third IEEE International Conference on Software Engineering and Formal Methods, pages 86--95, Washington, DC, USA, 2005. IEEE Computer Society.
[8]
V. Braberman, F. Fernández, D. Garbervetsky, and S. Yovine. Parametric prediction of heap memory requirements. In ISMM '08: Proceedings of the 7th international symposium on Memory management, pages 141--150, New York, NY, USA, 2008. ACM.
[9]
D. Cachera, T. Jensen, D. Pichardie, and G. Schneider. Certified memory usage analysis. In Formal Methods 05, volume 3582 of LNCS, pages 91--106. Springer-Verlag, 2005.
[10]
W.-N. Chin, H. H. Nguyen, C. Popeea, and S. Qin. Analysing memory resource bounds for low-level programs. In ISMM '08: Proceedings of the 7th international symposium on Memory management, pages 141--150, New York, NY, USA, 2008. ACM.
[11]
W.-N. Chin, H. H. Nguyen, S. Qin, and M. Rinard. Memory usage verification for oo programs. In SAS 05, pages 70--86. Springer, 2005.
[12]
K. Crary and S. Weirich. Resource bound certification. In Conference Record of the 27th Annual ACM Symposium on Principles of Programming Languages. ACM Press, 2000.
[13]
W. Fu and C. Hauser. A real-time garbage collection framework for embedded systems. In SCOPES '05: Proceedings of the 2005 workshop on Software and compilers for embedded, pages 20--26, New York, NY, USA, 2005. ACM.
[14]
S. Ghosh, M. Martonosi, and S. Malik. Cache miss equations: A compiler framework for analyzing and tuning memory behavior. ACM Trans. Program. Lang. Syst., 21(4):703--746, July 1999.
[15]
S. Gulwani, K. K. Mehra, and T. M. Chilimbi. Speed: precise and efficient static estimation of program computational complexity. In Proc. 36th Annual Symposium on Principles of Programming Languages (POPL 2009), 2009.
[16]
M. Hofmann and S. Jost. Static prediction of heap space usage for first-order functional programs. In POPL03 Symposium on Principles of Programming Languages, pages 185--197. ACM Press, 2003.
[17]
J. Hughes and L. Pareto. Recursion and dynamic data-structures in bounded space: Towards embedded ML programming. In Proceedings of the 1999 ACM SIGPLAN International Conference on Functional Programming, pages 70--81. ACM Press, Sept. 1999.
[18]
J. Hughes, L. Pareto, and A. Sabry. Proving the correctness of reactive systems using sized types. In Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages, pages 410--423. ACM Press, 1996.
[19]
D. Le Métayer. Ace: An automatic complexity evaluator. ACM Trans. Program. Lang. Syst., 10(2):248--266, Apr. 1988.
[20]
Y. A. Liu and G. Gómez. Automatic accurate time-bound analysis for high-level languages. In Proceedings of the ACM SIGPLAN 1998 Workshop on Languages, Compilers, and Tools for Embedded Systems, volume 1474 of Lecture Notes in Computer Science, pages 31--40. Springer-Verlag, 1998.
[21]
M. B. Monagan, K. O. Geddes, K. M. Heal, G. Labahn, S. M. Vorkoetter, J. McCarron, and P. DeMarco. Maple 10 Programming Guide. Maplesoft, 2005.
[22]
M. Rosendahl. Automatic complexity analysis. In Proceedings of the 4th International Conference on Functional Programming Languages and Computer Architecture, pages 144--156. ACM Press, Sept. 1989.
[23]
D. Sands. Complexity analysis for a lazy higher-order language. In N. D. Jones, editor, Proceedings of the 3rd European Symposium on Programming, volume 432 of Lecture Notes in Computer Science, pages 361--376. Springer-Verlag, Berlin, May 1990.
[24]
L. Unnikrishnan. Automatic Live Memory Bound Analysis for High-Level Languages. PhD thesis, Stony Brook University, 2008. Available at http://www.cs.sunysb.edu/~leena/thesis.pdf.
[25]
L. Unnikrishnan, S. D. Stoller, and Y. A. Liu. Optimized live heap bound analysis. In Proceedings of the 4th International Conference on Verification, Model Checking and Abstract Interpretation, Jan. 2003.
[26]
B. Wegbreit. Mechanical program analysis. Communications of the ACM, 18(9):528--538, Sept. 1975.
[27]
R. Wilhelm and C. Ferdinand. On predicting data cache behaviour for real-time systems. In Proceedings of the ACM SIGPLAN 1998 Workshop on Languages, Compilers, and Tools for Embedded Systems, volume 1474 of Lecture Notes in Computer Science, pages 16--30. Springer-Verlag, 1998.

Cited By

View all
  • (2019)Closure conversion is safe for spaceProceedings of the ACM on Programming Languages10.1145/33416873:ICFP(1-29)Online publication date: 26-Jul-2019
  • (2012)Space overhead bounds for dynamic memory management with partial compactionACM Transactions on Programming Languages and Systems10.1145/2362389.236239234:3(1-43)Online publication date: 5-Nov-2012
  • (2012)Making the common case the only case with anticipatory memory allocationACM Transactions on Storage10.1145/2078861.20788637:4(1-24)Online publication date: 2-Feb-2012
  • Show More Cited By

Index Terms

  1. Parametric heap usage analysis for functional programs

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      ISMM '09: Proceedings of the 2009 international symposium on Memory management
      June 2009
      158 pages
      ISBN:9781605583471
      DOI:10.1145/1542431
      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]

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 19 June 2009

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. functional languages
      2. garbage collection
      3. live heap space analysis
      4. recurrence relations

      Qualifiers

      • Research-article

      Conference

      ISMM '09
      Sponsor:

      Acceptance Rates

      ISMM '09 Paper Acceptance Rate 15 of 32 submissions, 47%;
      Overall Acceptance Rate 72 of 156 submissions, 46%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)3
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 25 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2019)Closure conversion is safe for spaceProceedings of the ACM on Programming Languages10.1145/33416873:ICFP(1-29)Online publication date: 26-Jul-2019
      • (2012)Space overhead bounds for dynamic memory management with partial compactionACM Transactions on Programming Languages and Systems10.1145/2362389.236239234:3(1-43)Online publication date: 5-Nov-2012
      • (2012)Making the common case the only case with anticipatory memory allocationACM Transactions on Storage10.1145/2078861.20788637:4(1-24)Online publication date: 2-Feb-2012
      • (2011)Making the common case the only case with anticipatory memory allocationProceedings of the 9th USENIX conference on File and stroage technologies10.5555/1960475.1960492(17-17)Online publication date: 15-Feb-2011
      • (2011)Task-level analysis for a language with async/finish parallelismACM SIGPLAN Notices10.1145/2016603.196768146:5(21-30)Online publication date: 11-Apr-2011
      • (2011)Task-level analysis for a language with async/finish parallelismProceedings of the 2011 SIGPLAN/SIGBED conference on Languages, compilers and tools for embedded systems10.1145/1967677.1967681(21-30)Online publication date: 11-Apr-2011
      • (2010)Parametric inference of memory requirements for garbage collected languagesACM SIGPLAN Notices10.1145/1837855.180667145:8(121-130)Online publication date: 5-Jun-2010
      • (2010)Parametric inference of memory requirements for garbage collected languagesProceedings of the 2010 international symposium on Memory management10.1145/1806651.1806671(121-130)Online publication date: 5-Jun-2010

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media