scispace - formally typeset
Search or ask a question
Journal ArticleDOI

A Static Analysis for Synthesizing Parametric Specifications of Dynamic Memory Consumption.

TL;DR: A general procedure for synthesizing non-linear formulas which conservatively estimate the quantity of memory explicitly allocated by a method as a function of its parameters is proposed.
Abstract: We present a static analysis for computing a parametric upper-bound of the amount of memory dynamically allocated by (Java-like) imperative object-oriented programs. We propose a general procedure for synthesizing non-linear formulas which conservatively estimate the quantity of memory explicitly allocated by a method as a function of its parameters. We have implemented the procedure and evaluated it on several benchmarks. Experimental results produced exact estimations for most test cases, and quite precise approximations for many of the others. We also apply our technique to compute usage in the context of scoped memory and discuss some open issues.

Content maybe subject to copyright    Report

Citations
More filters
Proceedings ArticleDOI
07 Jun 2008
TL;DR: 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.
Abstract: 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.

74 citations


Cites background or methods from "A Static Analysis for Synthesizing ..."

  • ...rsizem(Pm) can be computed, in may cases, using [7] or it may be specified by the developer....

    [...]

  • ...Thus, the technique presented in this paper has been integrated into the tool developed in [7]....

    [...]

  • ...In [7] we presented a technique for computing a parametric upper-bound of the amount of memory dynamically requested by Java-like imperative programs....

    [...]

  • ...Binding invariants can be obtained, for instance, from local program invariants as in [7]....

    [...]

  • ...Without getting into more details (see [7] and following sections), the polynomials P1(h....

    [...]

Proceedings ArticleDOI
21 Oct 2007
TL;DR: The prototype implementation of a heap space analysis for (sequential) Java bytecode is reported and demonstrated by means of a series of examples which illustrate how the analysis naturally encompasses standard data-structures like lists, trees and arrays with several dimensions written in object-oriented programming style.
Abstract: This article presents a heap space analysis for (sequential) Java bytecode The analysis generates heap space cost relations which define at compile-time the heap consumption of a program as a function of its data size These relations can be used to obtain upper bounds on the heap space located during the execution of the different methods In addition, we describe how to refine the cost relations, by relying on escape analysis, in order to take into account the heap space that can be safely deallocated by the garbage collector upon exit from a corresponding method These refined cost relations are then used to infer upper bounds on the active heap space upon methods return Example applications for the analysis consider inference of constant heap usage and heap usage proportional to the data size (including polynomial and exponential heap consumption) Our prototype implementation is reported and demonstrated by means of a series of examples which illustrate how the analysis naturally encompasses standard data-structures like lists, trees and arrays with several dimensions written in object-oriented programming style

58 citations


Cites background from "A Static Analysis for Synthesizing ..."

  • ...On the other hand, the work of [9] deals also with Java source code, it is able to infer polynomial complexity though it does not handle recursion....

    [...]

Proceedings ArticleDOI
07 Jun 2008
TL;DR: This paper shows how memory resource bounds can be inferred for assembly-level programs, and relies on a Presburger solver to capture memory requirements symbolically, and to perform fixpoint analysis for loops and recursion.
Abstract: Embedded systems are becoming more widely used but these systems are often resource constrained. Programming models for these systems should take into formal consideration resources such as stack and heap. In this paper, we show how memory resource bounds can be inferred for assembly-level programs. Our inference process captures the memory needs of each method in terms of the symbolic values of its parameters. For better precision, we infer path-sensitive information through a novel guarded expression format. Our current proposal relies on a Presburger solver to capture memory requirements symbolically, and to perform fixpoint analysis for loops and recursion. Apart from safety in memory adequacy, our proposal can provide estimate on memory costs for embedded devices and improve performance via fewer runtime checks against memory bound.

58 citations

Proceedings ArticleDOI
05 Jun 2010
TL;DR: 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, and infers accurateupper bounds on the memory consumption for a reachability-based garbage collector.
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.

57 citations


Cites background from "A Static Analysis for Synthesizing ..."

  • ...A first safe approximation is to infer the total memory allocation T [2, 7] which accumulates the sizes of all objects created along the execution....

    [...]

Journal ArticleDOI
TL;DR: This paper proposes an extension of Bernstein expansion theory to more general parametric convex domains and illustrates its applicability to the resolution of memory issues with several application examples.
Abstract: Memory requirement estimation is an important issue in the development of embedded systems, since memory directly influences performance, cost and power consumption. It is therefore crucial to have tools that automatically compute accurate estimates of the memory requirements of programs to better control the development process and avoid some catastrophic execution exceptions. Many important memory issues can be expressed as the problem of maximizing a parametric polynomial defined over a parametric convex domain. Bernstein expansion is a technique that has been used to compute upper bounds on polynomials defined over intervals and parametric ldquoboxesrdquo. In this paper, we propose an extension of this theory to more general parametric convex domains and illustrate its applicability to the resolution of memory issues with several application examples.

48 citations


Additional excerpts

  • ...In [42], Braberman et al....

    [...]

References
More filters
Book
22 Oct 1999
TL;DR: This book is unique in providing an overview of the four major approaches to program analysis: data flow analysis, constraint-based analysis, abstract interpretation, and type and effect systems.
Abstract: Program analysis utilizes static techniques for computing reliable information about the dynamic behavior of programs. Applications include compilers (for code improvement), software validation (for detecting errors) and transformations between data representation (for solving problems such as Y2K). This book is unique in providing an overview of the four major approaches to program analysis: data flow analysis, constraint-based analysis, abstract interpretation, and type and effect systems. The presentation illustrates the extensive similarities between the approaches, helping readers to choose the best one to utilize.

1,955 citations


"A Static Analysis for Synthesizing ..." refers methods in this paper

  • ...To compute inductive variables we developed a conservative dataflow analysis that combines a live variables analysis augmented with field sensitivity with a loop inductive analysis [35]....

    [...]

Proceedings ArticleDOI
01 Jan 1978

1,772 citations


"A Static Analysis for Synthesizing ..." refers methods in this paper

  • ...Invariants can be either provided by programmer assertions “à la” JML [30], or computed using general analysis techniques [14, 13] or Java-oriented ones[36, 19, 17, 7]....

    [...]

Proceedings ArticleDOI
16 May 1999
TL;DR: This paper describes techniques for dynamically discovering invariants, along with an instrumenter and an inference engine that embody these techniques, and reports on the application of the engine to two sets of target programs.
Abstract: Explicitly stated program invariants can help programmers by identifying program properties that must be preserved when modifying code. In practice, however, these invariants are usually implicit. An alternative to expecting programmers to fully annotate code with invariants is to automatically infer likely invariants from the program itself. This research focuses on dynamic techniques for discovering invariants from execution traces. This article reports three results. First, it describes techniques for dynamically discovering invariants, along with an implementation, named Daikon, that embodies these techniques. Second, it reports on the application of Daikon to two sets of target programs. In programs from Gries's work (1981) on program derivation, the system rediscovered predefined invariants. In a C program lacking explicit invariants, the system discovered invariants that assisted a software evolution task. These experiments demonstrate that, at least for small programs, invariant inference is both accurate and useful. Third, it analyzes scalability issues, such as invariant detection runtime and accuracy, as functions of test suites and program points instrumented.

1,219 citations


"A Static Analysis for Synthesizing ..." refers methods in this paper

  • ...Even if the properties generated by Daikon have a high probability of being true in all runs, that is, being invariants, they might not be....

    [...]

  • ...Invariants can be either provided by programmer assertions “à la” JML [30], or computed using general analysis techniques [14, 13] or Java-oriented ones[36, 19, 17, 7]....

    [...]

  • ...It should be noted here that Daikon is a tool for dynamic dectection of “likely” invariants by executing the program over a set of test cases....

    [...]

  • ...All these results were achieved using the original code as input for the method and reducing human intervention to a minimum (i.e., creation of test cases for Daikon, strengthening some of automatically detected invariants and reducing some of automatically detected inductive sets)....

    [...]

  • ...In the experiments, local invariants were generated using Daikon[17]....

    [...]

Book
15 Jan 2000
TL;DR: RTSJ's features and the thinking behind the specification's design are explained, which aims to provide a platform-a Java execution environment and application program interface (API) that lets programmers correctly reason about the temporal behavior of executing software.
Abstract: New languages, programming disciplines, operating systems, and software engineering techniques sometimes hold considerable potential for real-time software developers. A promising area of interest-but one fairly new to the real-time community-is object-oriented programming. Java, for example, draws heavily from object orientation and is highly suitable for extension to real-time and embedded systems. Recognizing this fit between Java and real-time software development, the Real-Time for Java Experts Group (RTJEG) began developing the real-time specification for Java (RTSJ) in March 1999 under the Java Community Process. This article explains RTSJ's features and the thinking behind the specification's design. The goal of the RTJEG, of which the authors are both members, was to provide a platform-a Java execution environment and application program interface (API)-that lets programmers correctly reason about the temporal behavior of executing software.

1,094 citations


"A Static Analysis for Synthesizing ..." refers methods in this paper

  • ...Assuming the resulting expression is a symbolic estimator of the size of the memory region associated to the method’s scope, this information can be used to specify the size of the memory region to be allocated at run-time, as required by the RTSJ [3]....

    [...]

  • ...Memory estimators can be used both at compile- and run-time, for example, to set up the appropriate parameters required by the RTSJ scoped-memory API, to over estimate heap usage, to improve memory management and to accurately determine whether a new program can be safely dynamically loaded and scheduled without disturbing other programs behavior....

    [...]

  • ...8 Table 5: Memory captured by methods m0, m1 and m2 Assuming the resulting expression is a symbolic estimator of the size of the memory region associated to the method’s scope, this information can be used to specify the size of the memory region to be allocated at run-time, as required by the RTSJ [3]....

    [...]

Proceedings Article
01 Jan 1999

598 citations


Additional excerpts

  • ...Call graphs are obtained with Soot [38]....

    [...]