Customizable resource usage analysis for java bytecode

Automatic cost analysis of programs has been traditionally studied in terms of a number of concrete, predefined resources such as execution steps, time, or memory. However, the increasing relevance of analysis applications such as static debugging and/or certification of user-level properties (including for mobile code) makes it interesting to develop analyses for resource notions that are actually applicationdependent. This may include, for example, bytes sent or received by an application, number of files left open, number of SMSs sent or received, number of accesses to a database, money spent, energy consumption, etc. We present a fully automated analysis for inferring upper bounds on the usage that a Java bytecode program makes of a set of application programmer-definable resources. In our context, a resource is defined by programmer-provided annotations which state the basic consumption that certain program elements make of that resource. From these definitions our analysis derives functions which return an upper bound on the usage that the whole program (and individual blocks) make of that resource for any given set of input data sizes. The analysis proposed is independent of the particular resource. We also present some experimental results from a prototype implementation of the approach covering an ample set of interesting resources.

[1]  Saumya K. Debray,et al.  Cost analysis of logic programs , 1993, TOPL.

[2]  Lothar Thiele,et al.  Design for Time-Predictability , 2004, Design of Systems with Predictable Behaviour.

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

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

[5]  Ralph Benzinger,et al.  Automated higher-order complexity analysis , 2004, Theor. Comput. Sci..

[6]  Saumya K. Debray,et al.  Task granularity analysis in logic programs , 1990, PLDI '90.

[7]  Manuel V. Hermenegildo,et al.  Abstraction-Carrying Code , 2005, LPAR.

[8]  Germán Puebla,et al.  Poly-controlled partial evaluation , 2006, PPDP '06.

[9]  Reinhard Wilhelm Timing Analysis and Timing Predictability , 2004, FMCO.

[10]  Saumya K. Debray,et al.  A Methodology for Granularity-Based Control of Parallelism in Logic Programs , 1996, J. Symb. Comput..

[11]  Herbert S. Wilf,et al.  Algorithms and Complexity , 1994, Lecture Notes in Computer Science.

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

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

[14]  Yanhong A. Liu,et al.  Automatic time-bound analysis for a higher-order language , 2002, PEPM '02.

[15]  Sébastien Lafond,et al.  Energy consumption analysis for two embedded Java virtual machines , 2007, J. Syst. Archit..

[16]  Saumya K. Debray,et al.  Lower Bound Cost Estimation for Logic Programs , 1997, ILPS.

[17]  Manuel V. Hermenegildo,et al.  Precise Set Sharing Analysis for Java-Style Programs , 2008, VMCAI.

[18]  Bernd Grobauer,et al.  Cost recurrences for DML programs , 2001, ICFP '01.

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

[20]  Jorge A. Navas,et al.  A Flexible, (C)LP-Based Approach to the Analysis of Object-Oriented Programs , 2008, LOPSTR.

[21]  Bernd Becker,et al.  Automatic Identification of Timing Anomalies for Cycle-Accurate Worst-Case Execution Time Analysis , 2006, 2006 IEEE Design and Diagnostics of Electronic Circuits and systems.

[22]  Manuel V. Hermenegildo,et al.  Integrated program debugging, verification, and optimization using abstract interpretation (and the Ciao system preprocessor) , 2005, Sci. Comput. Program..

[23]  Manuel V. Hermenegildo,et al.  Abstraction carrying code and resource-awareness , 2005, PPDP.

[24]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[25]  Kevin Hammond,et al.  Inferring Cost Equations for Recursive, Polymorphic and Higher-Order Functional Programs , 2003, IFL.

[26]  David Sands,et al.  A Naïve Time Analysis and its Theory of Cost Equivalence , 1995, J. Log. Comput..

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

[28]  David F. Bacon,et al.  Fast static analysis of C++ virtual function calls , 1996, OOPSLA '96.

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

[30]  Michael Leuschel,et al.  Self-tuning resource aware specialisation for prolog , 2005, PPDP.

[31]  Iain Bate,et al.  Java virtual-machine support for portable worst-case execution-time analysis , 2002, Proceedings Fifth IEEE International Symposium on Object-Oriented Real-Time Distributed Computing. ISIRC 2002.

[32]  Jorge A. Navas,et al.  User-Definable Resource Bounds Analysis for Logic Programs , 2007, ICLP.