skip to main content
10.1145/1806651.1806671acmconferencesArticle/Chapter ViewAbstractPublication PagesismmConference Proceedingsconference-collections
research-article

Parametric inference of memory requirements for garbage collected languages

Published:05 June 2010Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. H. Boehm. An artificial garbage collection benchmark. http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_bench.html.Google ScholarGoogle Scholar
  6. V. Braberman, F. Fernández, D. Garbervetsky, and S. Yovine. Parametric Prediction of Heap Memory Requirements. In ISMM. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarCross RefCross Ref
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Cherem and R. Rugina. Region analysis and transformation for java programs. In ISMM, pages 85--96. ACM Press, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In POPL, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Craig and M. Leuschel. A compiler generator for constraint logic programs. In Ershov Memorial Conference, pages 148--161, 2003.Google ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Hofmann and D. Rodriguez. Efficient Type-Checking for Amortised Heap-Space Analysis. In Proc. of CSL'09, LNCS. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, New York, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. H. Lehner and P. Müller. Formal translation of bytecode into BoogiePL. In Bytecode'07, ENTCS, pages 35--50. Elsevier, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1996.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. L. Unnikrishnan and S. Stoller. Parametric heap usage analysis for functional programs. In Proc. of ISMM'09. ACM Press, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Parametric inference of memory requirements for garbage collected languages

          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

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!