ABSTRACT
The accurate prediction of program's memory requirements is a critical component in software development. Existing heap space analyses either do not take deallocation into account or adopt specific models of garbage collectors which do not necessarily correspond to the actual memory usage. We present a novel approach to inferring upper bounds on memory requirements of Java-like programs which is parametric on the notion of object lifetime, i.e., on when objects become collectible. If objects lifetimes are inferred by a reachability analysis, then our analysis infers accurate upper bounds on the memory consumption for a reachability-based garbage collector. Interestingly, if objects lifetimes are inferred by a heap liveness analysis, then we approximate the program minimal memory requirement, i.e., the peak memory usage when using an optimal garbage collector which frees objects as soon as they become dead. The key idea is to integrate information on objects lifetimes into the process of generating the recurrence equations which capture the memory usage at the different program states. If the heap size limit is set to the memory requirement inferred by our analysis, it is ensured that execution will not exceed the memory limit with the only assumption that garbage collection works when the limit is reached. Experiments on Java bytecode programs provide evidence of the feasibility and accuracy of our analysis.
- E. Albert, P. Arenas, S. Genaim, G. Puebla, and D. Zanardini Cost Analysis of Java Bytecode. In Rocco De Nicola, editor, 16th European Symposium on Programming, ESOP'07, volume 4421 of Lecture Notes in Computer Science, pages 157--172. Springer, March 2007. Google Scholar
Digital Library
- E. Albert, S. Genaim, and M. Gómez-Zamalloa. Heap Space Analysis for Java Bytecode. In Proceedings of the 6th International Symposium on Memory Management (ISMM'07), pages 105--116, New York, NY, USA, October 2007. ACM Press. Google Scholar
Digital Library
- E. Albert, S. Genaim, and M. Gómez-Zamalloa. Live Heap Space Analysis for Languages with Garbage Collection. In 8th international symposium on Memory management, pages 129--138, New York, NY, USA, June 2009. ACM Press. Google Scholar
Digital Library
- Elvira Albert, Puri Arenas, Samir Genaim, and German Puebla. Automatic Inference of Upper Bounds for Recurrence Relations in Cost Analysis. In María Alpuente and Germán Vidal, editors, Static Analysis, 15th International Symposium, SAS 2008, Valencia, Spain, July 15-17, 2008, Proceedings, volume 5079 of Lecture Notes in Computer Science, pages 221--237. Springer-Verlag, July 2008. Google Scholar
Digital Library
- H. Boehm. An artificial garbage collection benchmark. http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_bench.html.Google Scholar
- V. Braberman, F. Fernández, D. Garbervetsky, and S. Yovine. Parametric Prediction of Heap Memory Requirements. In ISMM. ACM Press, 2008. Google Scholar
Digital Library
- V. Braberman, D. Garbervetsky, and S. Yovine. A static analysis for synthesizing parametric specifications of dynamic memory consumption. Journal of Object Technology, 5(5):31--58, 2006.Google Scholar
Cross Ref
- Brendon Cahoon and Kathryn S. McKinley. Data flow analysis for software prefetching linked data structures in Java. In IEEE PACT pages 280--291, 2001. Google Scholar
Digital Library
- S. Cherem and R. Rugina. Region analysis and transformation for java programs. In ISMM, pages 85--96. ACM Press, 2004. Google Scholar
Digital Library
- W.-N. Chin, H. H. Nguyen, S. Qin, and M. C. Rinard. Memory Usage Verification for OO Programs. In Proc. of SAS'05, volume 3672 of LNCS, pages 70--86, 2005. Google Scholar
Digital Library
- W-N. Chin, H. H. Nguyen, C. Popeea, and S. Qin. Analysing Memory Resource Bounds for Low-Level Programs. In ISMM. ACM Press, 2008. Google Scholar
Digital Library
- P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In POPL, 1978. Google Scholar
Digital Library
- S. Craig and M. Leuschel. A compiler generator for constraint logic programs. In Ershov Memorial Conference, pages 148--161, 2003.Google Scholar
- S. Gulwani, K. K. Mehra, and T. M. Chilimbi. Speed: precise and efficient static estimation of program computational complexity. In POPL, pages 127--139. ACM, 2009. Google Scholar
Digital Library
- M. Hofmann and S. Jost. Static Prediction of Heap Space Usage for First-Order Functional Programs. In 30th Symposium on Principles of Programming Languages (POPL'03), pages 185--197. ACM Press, 2003. Google Scholar
Digital Library
- M. Hofmann and D. Rodriguez. Efficient Type-Checking for Amortised Heap-Space Analysis. In Proc. of CSL'09, LNCS. Springer, 2009. Google Scholar
Digital Library
- N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, New York, 1993. Google Scholar
Digital Library
- H. Lehner and P. Müller. Formal translation of bytecode into BoogiePL. In Bytecode'07, ENTCS, pages 35--50. Elsevier, 2007. Google Scholar
Digital Library
- M. Leuschel and M. Bruynooghe. Logic Program Specialisation through Partial Deduction: Control Issues. Theory and Practice of Logic Programming, 2(4 & 5):461--515, July & September 2002. Google Scholar
Digital Library
- T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1996.Google Scholar
Digital Library
- R. Shaham, E. K. Kolodner, and S. Sagiv. Estimating the impact of heap liveness information on space consumption in java. In ISMM, pages 171--182. ACM Press, 2002. Google Scholar
Digital Library
- L. Unnikrishnan and S. Stoller. Parametric heap usage analysis for functional programs. In Proc. of ISMM'09. ACM Press, 2009. Google Scholar
Digital Library
- R. Vallee-Rai, L. Hendren, V. Sundaresan, P. Lam, E. Gagnon, and P. Co. Soot - a Java optimization framework. In Proc. of Conference of the Centre for Advanced Studies on Collaborative Research (CASCON), pages 125--135, 1999. Google Scholar
Digital Library
- John Whaley and Monica S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In PLDI, pages 131--144. ACM, 2004. Google Scholar
Digital Library
Index Terms
Parametric inference of memory requirements for garbage collected languages
Recommendations
Parametric inference of memory requirements for garbage collected languages
ISMM '10The accurate prediction of program's memory requirements is a critical component in software development. Existing heap space analyses either do not take deallocation into account or adopt specific models of garbage collectors which do not necessarily ...
Live heap space analysis for languages with garbage collection
ISMM '09: Proceedings of the 2009 international symposium on Memory managementThe peak heap consumption of a program is the maximum size of the live data on the heap during the execution of the program, i.e., the minimum amount of heap space needed to run the program without exhausting the memory. It is well-known that garbage ...
Age-based garbage collection
Modern generational garbage collectors look for garbage among the young objects, because they have high mortality; however, these objects include the very youngest objects, which clearly are still live. We introduce new garbage collection algorithms, ...







Comments