Parametric prediction of heap memory requirements

This work presents a technique to compute symbolic polynomial approximations of the amount of dynamic memory required to safely execute a method without running out of memory, for Javalike imperative programs. We consider object allocations and deallocations made by the method and the methods it transitively calls. More precisely, given an initial configuration of the stack and the heap, the peak memory consumption is the maximum space occupied by newly created objects in all states along a run from it. We over-approximate the peak memory consumption using a scopedmemory management where objects are organized in regions associated with the lifetime of methods. We model the problem of computing the maximum memory occupied by any region configuration as a parametric polynomial optimization problem over a polyhedral domain and resort to Bernstein basis to solve it. We apply the developed tool to several benchmarks.

[1]  James Gosling,et al.  The Real-Time Specification for Java , 2000, Computer.

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

[3]  Parosh Aziz Abdulla,et al.  A Survey of Regular Model Checking , 2004, CONCUR.

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

[5]  Kathryn S. McKinley,et al.  Data flow analysis for software prefetching linked data structures in Java , 2001, Proceedings 2001 International Conference on Parallel Architectures and Compilation Techniques.

[6]  David F. Bacon,et al.  Garbage collection for embedded systems , 2004, EMSOFT '04.

[7]  Philippe Clauss,et al.  A Symbolic Approach to Bernstein Expansion for Program Analysis and Optimization , 2004, CC.

[8]  Laurie Hendren,et al.  Soot---a java optimization framework , 1999 .

[9]  Mads Tofte,et al.  Region-based Memory Management , 1997, Inf. Comput..

[10]  Christophe Rippert,et al.  Semi-Automatic Region-Based Memory Management for Real-Time Java Embedded Systems , 2007, 13th IEEE International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA 2007).

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

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

[13]  Shengchao Qin,et al.  Verifying safety policies with size properties and alias controls , 2005, ICSE.

[14]  Martin Hofmann,et al.  Type-Based Amortised Heap-Space Analysis , 2006, ESOP.

[15]  Philippe Clauss,et al.  Symbolic Polynomial Maximization Over Convex Sets and Its Application to Memory Requirement Estimation , 2009, IEEE Transactions on Very Large Scale Integration (VLSI) Systems.

[16]  David Detlefs A hard look at hard real-time garbage collection , 2004, Seventh IEEE International Symposium onObject-Oriented Real-Time Distributed Computing, 2004. Proceedings..

[17]  Sergio Yovine,et al.  A Static Analysis for Synthesizing Parametric Specifications of Dynamic Memory Consumption , 2006, J. Object Technol..

[18]  Elvira Albert,et al.  Cost Analysis of Java Bytecode , 2007, ESOP.

[19]  David Gay,et al.  Language support for regions , 2001, PLDI '01.

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

[21]  Martin C. Rinard,et al.  Pointer and escape analysis for multithreaded programs , 2001, PPoPP '01.

[22]  Sergio Yovine,et al.  Fast Escape Analysis for Region-based Memory Management , 2005, AIOOL@VMCAI.

[23]  Ovidiu Gheorghioiu,et al.  Statistically determining memory consumption of real-time Java threads , 2002 .

[24]  Sigmund Cherem,et al.  Region analysis and transformation for Java programs , 2004, ISMM '04.

[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).

[26]  Stephen McCamant,et al.  The Daikon system for dynamic detection of likely invariants , 2007, Sci. Comput. Program..

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

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

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