Parametric heap usage analysis for functional programs

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.

[1]  Sharad Malik,et al.  Cache miss equations: a compiler framework for analyzing and tuning memory behavior , 1999, TOPL.

[2]  Reinhard Wilhelm,et al.  On Predicting Data Cache Behavior for Real-Time Systems , 1998, LCTES.

[3]  Martin Hofmann,et al.  Static prediction of heap space usage for first-order functional programs , 2003, POPL '03.

[4]  Yanhong A. Liu,et al.  Automatic Accurate Time-Bound Analysis for High-Level Languages , 1998, LCTES.

[5]  G. Barthe,et al.  Mobile Resource Guarantees for Smart Devices , 2005 .

[6]  Elvira Albert,et al.  Automatic Inference of Upper Bounds for Recurrence Relations in Cost Analysis , 2008, SAS.

[7]  Daniel Le Métayer,et al.  ACE: an automatic complexity evaluator , 1988, TOPL.

[8]  Elvira Albert,et al.  Heap space analysis for java bytecode , 2007, ISMM '07.

[9]  Ben Wegbreit,et al.  Mechanical program analysis , 1975, CACM.

[10]  Yanhong A. Liu,et al.  Optimized Live Heap Bound Analysis , 2002, VMCAI.

[11]  John Hughes,et al.  Recursion and dynamic data-structures in bounded space: towards embedded ML programming , 1999, ICFP '99.

[12]  Amr Sabry,et al.  Proving the correctness of reactive systems using sized types , 1996, POPL '96.

[13]  David Sands,et al.  Complexity Analysis for a Lazy Higher-Order Language , 1989, Functional Programming.

[14]  Elvira Albert,et al.  Live heap space analysis for languages with garbage collection , 2009, ISMM '09.

[15]  Karl Crary,et al.  Resource bound certification , 2000, POPL '00.

[16]  Mads Rosendahl,et al.  Automatic complexity analysis , 1989, FPCA.

[17]  Shengchao Qin,et al.  Analysing memory resource bounds for low-level programs , 2008, ISMM '08.

[18]  Carl H. Hauser,et al.  A real-time garbage collection framework for embedded systems , 2005, SCOPES '05.

[19]  David F. Bacon,et al.  Realtime Garbage Collection , 2007, ACM Queue.

[20]  Radu Grosu,et al.  Automatic live memory bound analysis for high-level languages , 2008 .

[21]  David Cachera,et al.  Certified Memory Usage Analysis , 2005, FM.

[22]  Sergio Yovine,et al.  Parametric prediction of heap memory requirements , 2008, ISMM '08.

[23]  Shengchao Qin,et al.  Memory Usage Verification for OO Programs , 2005, SAS.

[24]  Sumit Gulwani,et al.  SPEED: precise and efficient static estimation of program computational complexity , 2009, POPL '09.

[25]  Gilles Barthe,et al.  Precise analysis of memory consumption using program logics , 2005, Third IEEE International Conference on Software Engineering and Formal Methods (SEFM'05).