## Automatic accurate stack space and heap space analysis for high-level languages (2000)

### Cached

### Download Links

Citations: | 13 - 7 self |

### BibTeX

@TECHREPORT{Unnikrishnan00automaticaccurate,

author = {Leena Unnikrishnan and Scott D. Stoller and Yanhong A. Liu},

title = {Automatic accurate stack space and heap space analysis for high-level languages},

institution = {},

year = {2000}

}

### OpenURL

### Abstract

This paper describes a general approach for automatic and accurate space and space-bound analyses for high-level languages, considering stack space, heap allocation and live heap space usage of programs. The approach is based on program analysis and transformations and is fully automatic. The analyses produce accurate upper bounds in the presence of partially known input structures. The analyses have been implemented, and experimental results con rm the accuracy. 1

### Citations

8543 |
Introduction to Algorithms
- Cormen, Leiserson, et al.
- 1990
(Show Context)
Citation Context ...standard quadratic-time version. The version of merge sort tested is the one that splits the input list into sublists containing the elements at odd and even positions. Dynamic programming algorithms =-=[43, 6]-=- are used for binomial coecient, longest common subsequence and string edit. Binary-tree insertion involves insertion of an item into a complete binary tree in which each node is a list containing an ... |

1566 | The definition of Standard ML
- MILNER, TOFTE, et al.
- 1990
(Show Context)
Citation Context ...tors, which are vectors of integers with one element corresponding to each function (in a given program). Let i f denote the index associated with function f . Let PF 1 The keywords are taken from ML =-=[37]-=-. Our implementation uses Scheme syntax. 3 of 31 be a vector of primitive parameters such that PF [i f ] is the size of a stack frame for f . Stack frame sizes of functions can be accurately determine... |

731 |
Structure and interpretation of computer programs. MIT electrical engineering and computer science series
- Abelson, Sussman, et al.
- 1991
(Show Context)
Citation Context ...ns based on the same control conditions to be merged, leading to more accurate space bounds, which can be computed more eciently as well. We choose to start by analyzing a functional subset of Scheme =-=[1, 8]-=- for three reasons. First, high-level languages with features like automatic garbage collection are becoming increasingly widely used. Second, existing work on analysis of functional programs, includi... |

450 | The Omega test: a fast and practical integer programming algorithm for dependence analysis
- Pugh
- 1991
(Show Context)
Citation Context ...ams must be rewritten to have feasible types [24, 23]. Chin and Khoo [4] propose a method for calculating sized types by inferring constraints on size and then simplifying the constraints using Omega =-=[42]-=-. Their analysis results do not correspond to stack space or heap space in general. Furthermore, Omega can only reason about constraints expressed as linear functions. To summarize, this work is asrst... |

411 |
Garbage Collection: Algorithms for Automatic Dynamic Memory Management
- JONES, LINS
- 1997
(Show Context)
Citation Context ...ion analyses are similar to the time-bound analysis proposed by Liu and Gomez [34]. Constructions of the space and space-bound functions for analyzing live heap space are based on reference counting [=-=28]-=-. We are analyzing functional programs, so reference counting provides an accurate basis for the analysis. If imperative updates to data constructions are allowed (e.g., setcdr ! in Scheme), reference... |

293 | Solving shape-analysis problems in languages with destructive updating - Sagiv, Reps, et al. - 1998 |

159 | Reasoning about Time in Higher-Level Language Software
- Shaw
- 1989
(Show Context)
Citation Context ...ary trees with n nodes and unknown elements. 9 Related work There has been a large amount of work on analyzing program cost or resource complexities, but the majority of it is on time analysis, e.g., =-=[53, 32, 11, 45, 51, 49, 12, 44, 33, 47, 34-=-]. Some techniques for time analysis can 28 of 31 be adapted for space analysis, for example, as we did for stack space and heap allocation analysis. Analysis of live heap space has an important diere... |

134 | Cache miss equations: a compiler framework for analyzing and tuning memory behavior
- Ghosh, Martonosi, et al.
- 1999
(Show Context)
Citation Context ...ortant dierence from all these other analyses: it involves explicit analysis of the graph structure of the data. Most of the work related to analysis of space is on analysis of cache behavior, e.g., [=-=10, 38, 54, 14, 33]-=-, much of which is at a lower language level, for compiler generated code, and much of which is for facilitating time analysis. Our analyses bound stack space and heap space and are completely at the ... |

122 | Proving the correctness of reactive systems using sized types
- Hughes, Pareto, et al.
- 1996
(Show Context)
Citation Context ... that facilitate dynamic reference counting; their method is also simple and powerful, compared to relying completely on dynamic reference counting or using only static analysis. Several type systems =-=[24, 23, 7]-=- have been proposed for reasoning about space and time bounds, and some of them include implementations of type checkers [24, 7]. They require programmers to annotate their programs with cost function... |

122 |
Predicting program execution times by analyzing static and dynamic program paths
- PARK
- 1993
(Show Context)
Citation Context ...vior. Space analysis is also important for accurate prediction of running time [20]. For example, analysis of worst-case execution time in real-time systems often uses loop bounds or recursion depths =-=[39, 2]-=-; the former is often determined by the size of the data being processed, and the latter corresponds to the maximum size of the call stack. Also, memory allocation and garbage collection, as well as c... |

118 |
The Art of Computer Programming, Volume 1
- Knuth
- 1998
(Show Context)
Citation Context ...ory access as the performance bottleneck. Much work on space analysis has been done in algorithm complexity analysis and systems. The former is in terms of asymptotic space complexity in closed forms =-=[30-=-]. The latter is mostly in the form of tracing memory behavior or analyzing cache eects at the machine level [36, 54]. What has been lacking is analysis of stack space and heap space for high-level la... |

117 | Resource bound certification
- Crary, Weirich
- 2000
(Show Context)
Citation Context ... that facilitate dynamic reference counting; their method is also simple and powerful, compared to relying completely on dynamic reference counting or using only static analysis. Several type systems =-=[24, 23, 7]-=- have been proposed for reasoning about space and time bounds, and some of them include implementations of type checkers [24, 7]. They require programmers to annotate their programs with cost function... |

99 | An accurate worst case timing analysis for RISC processors
- Lim, Bae, et al.
- 1995
(Show Context)
Citation Context ...ary trees with n nodes and unknown elements. 9 Related work There has been a large amount of work on analyzing program cost or resource complexities, but the majority of it is on time analysis, e.g., =-=[53, 32, 11, 45, 51, 49, 12, 44, 33, 47, 34-=-]. Some techniques for time analysis can 28 of 31 be adapted for space analysis, for example, as we did for stack space and heap allocation analysis. Analysis of live heap space has an important diere... |

93 |
The De nition of Standard ML
- Milner, Tofte, et al.
- 1990
(Show Context)
Citation Context ...ectors, which are vectors of integers with one element corresponding to each function (in a given program). Let if denote the index associated with function f. Let PF 1 The keywords are taken from ML =-=[37]-=-. Our implementation uses Scheme syntax. 3of28sbe a vector of primitive parameters such thatPF [if ] is the size of a stack frame for f. Stack frame sizes of functions can be accurately determined bas... |

87 |
Mechanical Program Analysis
- Wegbreit
- 1975
(Show Context)
Citation Context ...onal analysis of the time and space complexity of algorithms, inputs are characterized by their size. Accommodating this requires manual or semi-automatic transformation of the time or space function =-=[53, 32, 55]-=-. The analysis is mainly asymptotic. A theoretically challenging problem that arises in this approach is optimizing the time-bound or space-bound function to a closed form in terms of the input size [... |

77 |
Automatic complexity analysis
- Rosendahl
- 1989
(Show Context)
Citation Context ...]. The analysis is mainly asymptotic. A theoretically challenging problem that arises in this approach is optimizing the time-bound or space-bound function to a closed form in terms of the input size =-=[53, 5, 32, 45, 12]-=-. Although much progress has been made in this area, closed forms are known only for subclasses of functions. Thus, such optimization can not be automatically done for analyzing general programs. Rose... |

76 | Recursion and dynamic data-structures in bounded space: towards embedded ml programming
- Hughes, Pareto
- 1999
(Show Context)
Citation Context ... that facilitate dynamic reference counting; their method is also simple and powerful, compared to relying completely on dynamic reference counting or using only static analysis. Several type systems =-=[24, 23, 7]-=- have been proposed for reasoning about space and time bounds, and some of them include implementations of type checkers [24, 7]. They require programmers to annotate their programs with cost function... |

74 | Scheduling garbage collection in Embedded systems
- Henriksson
- 1998
(Show Context)
Citation Context ...e and thus help analyze cache misses or page swapping; and it can determine memory allocation and garbage collection behavior. Space analysis is also important for accurate prediction of running time =-=[20]-=-. For example, analysis of worst-case execution time in real-time systems often uses loop bounds or recursion depths [39, 2]; the former is often determined by the size of the data being processed, an... |

70 |
The Scheme Programming Language
- Dybvig
- 1987
(Show Context)
Citation Context ...ns based on the same control conditions to be merged, leading to more accurate space bounds, which can be computed more eciently as well. We choose to start by analyzing a functional subset of Scheme =-=[1, 8]-=- for three reasons. First, high-level languages with features like automatic garbage collection are becoming increasingly widely used. Second, existing work on analysis of functional programs, includi... |

66 | A semantic model of reference counting and its abstraction
- Hudak
- 1986
(Show Context)
Citation Context ... program annotations; it can do time analysis automatically as well, as shown by the work of Liu and Gomez [34]. A number of people have worked on static analysis for compile-time garbage collection [=-=22, 21, 16, 29, 27, 19, 25, 50, 18, 52]-=-, and one of the approaches is static reference counting [22, 21]. For compile-time optimization, the reference count includes only pointers to memory cells that will be used in the rest of the execut... |

58 | On the false path problem in hard realtime programs
- Altenbernd
- 1996
(Show Context)
Citation Context ...vior. Space analysis is also important for accurate prediction of running time [20]. For example, analysis of worst-case execution time in real-time systems often uses loop bounds or recursion depths =-=[39, 2]-=-; the former is often determined by the size of the data being processed, and the latter corresponds to the maximum size of the call stack. Also, memory allocation and garbage collection, as well as c... |

56 | Automatic average{case analysis of algorithms
- Flajolet, Salvy, et al.
- 1991
(Show Context)
Citation Context ...]. The analysis is mainly asymptotic. A theoretically challenging problem that arises in this approach is optimizing the time-bound or space-bound function to a closed form in terms of the input size =-=[53, 5, 32, 45, 12]-=-. Although much progress has been made in this area, closed forms are known only for subclasses of functions. Thus, such optimization can not be automatically done for analyzing general programs. Rose... |

52 | Calculating sized types
- Chin, Khoo
- 2001
(Show Context)
Citation Context ...of type checkers [24, 7]. They require programmers to annotate their programs with cost functions as types. Furthermore, some programs must be rewritten to have feasible types [24, 23]. Chin and Khoo =-=[4]-=- propose a method for calculating sized types by inferring constraints on size and then simplifying the constraints using Omega [42]. Their analysis results do not correspond to stack space or heap sp... |

52 | Applying Compiler Techniques to Cache Behavior Prediction
- Ferdinand, Martin, et al.
- 1997
(Show Context)
Citation Context ...ortant dierence from all these other analyses: it involves explicit analysis of the graph structure of the data. Most of the work related to analysis of space is on analysis of cache behavior, e.g., [=-=10, 38, 54, 14, 33]-=-, much of which is at a lower language level, for compiler generated code, and much of which is for facilitating time analysis. Our analyses bound stack space and heap space and are completely at the ... |

51 |
ACE: an automatic complexity evaluator
- Métayer
(Show Context)
Citation Context ...onal analysis of the time and space complexity of algorithms, inputs are characterized by their size. Accommodating this requires manual or semi-automatic transformation of the time or space function =-=[53, 32, 55]-=-. The analysis is mainly asymptotic. A theoretically challenging problem that arises in this approach is optimizing the time-bound or space-bound function to a closed form in terms of the input size [... |

47 |
The Analysis of Algorithms
- PURDOM, BROWN
(Show Context)
Citation Context ...standard quadratic-time version. The version of merge sort tested is the one that splits the input list into sublists containing the elements at odd and even positions. Dynamic programming algorithms =-=[43, 6]-=- are used for binomial coecient, longest common subsequence and string edit. Binary-tree insertion involves insertion of an item into a complete binary tree in which each node is a list containing an ... |

47 | Complexity analysis for a lazy higher-order language
- Sands
- 1990
(Show Context)
Citation Context ...ary trees with n nodes and unknown elements. 9 Related work There has been a large amount of work on analyzing program cost or resource complexities, but the majority of it is on time analysis, e.g., =-=[53, 32, 11, 45, 51, 49, 12, 44, 33, 47, 34-=-]. Some techniques for time analysis can 28 of 31 be adapted for space analysis, for example, as we did for stack space and heap allocation analysis. Analysis of live heap space has an important diere... |

46 | Static dependent costs for estimating execution time
- Reistad, Gifford
- 1994
(Show Context)
Citation Context |

45 |
Compile-time garbage collection by sharing analysis
- Jones, Metayer
- 1989
(Show Context)
Citation Context ... program annotations; it can do time analysis automatically as well, as shown by the work of Liu and Gomez [34]. A number of people have worked on static analysis for compile-time garbage collection [=-=22, 21, 16, 29, 27, 19, 25, 50, 18, 52]-=-, and one of the approaches is static reference counting [22, 21]. For compile-time optimization, the reference count includes only pointers to memory cells that will be used in the rest of the execut... |

43 |
The Aggregate Update Problem in Functional Programming Systems. Pages 300–313 of
- Hudak, Bloss
- 1985
(Show Context)
Citation Context ... program annotations; it can do time analysis automatically as well, as shown by the work of Liu and Gomez [34]. A number of people have worked on static analysis for compile-time garbage collection [=-=22, 21, 16, 29, 27, 19, 25, 50, 18, 52]-=-, and one of the approaches is static reference counting [22, 21]. For compile-time optimization, the reference count includes only pointers to memory cells that will be used in the rest of the execut... |

42 | Worst-case execution time analysis for modern hardware architectures
- Ottosson, Sjödin
- 1997
(Show Context)
Citation Context ...ortant dierence from all these other analyses: it involves explicit analysis of the graph structure of the data. Most of the work related to analysis of space is on analysis of cache behavior, e.g., [=-=10, 38, 54, 14, 33]-=-, much of which is at a lower language level, for compiler generated code, and much of which is for facilitating time analysis. Our analyses bound stack space and heap space and are completely at the ... |

38 | Automatic accurate time-bound analysis for high-level languages
- Liu, Gomez
- 1998
(Show Context)
Citation Context ...the original program depends on unknown parts of the given partially known input structures. Stack space and heap allocation analyses are similar to the time-bound analysis proposed by Liu and Gomez [=-=34]-=-. Constructions of the space and space-bound functions for analyzing live heap space are based on reference counting [28]. We are analyzing functional programs, so reference counting provides an accur... |

34 |
Effectiveness of Trace Sampling for Performance Debugging Tools
- Martonosi, Gupta, et al.
- 1993
(Show Context)
Citation Context ...is and systems. The former is in terms of asymptotic space complexity in closed forms [30]. The latter is mostly in the form of tracing memory behavior or analyzing cache effects at the machine level =-=[36, 54]-=-. What has been lacking is analysis of stack space and heap space for high-level languages, in particular, automatic and accurate techniques for live heap space analysis for languages with garbage col... |

32 |
Analysis of functional programs to detect run-time garbage cells
- Inoue, Seki, et al.
- 1988
(Show Context)
Citation Context ...e stack and thus would not yet be garbage collected by standard run-time garbage collectors. Thus, we had to develop a dierent reference counting method for the live space analysis. Inoue and others [=-=26]-=- analyze functional programs to detect run-time garbage, bysnding run-time garbage conservatively at compile-time. Their result is an approximation without any information about the input. Also, they ... |

26 | D.: Dynamic programming via static incrementalization - Liu, Stoller - 2003 |

23 | Automatic TimeBound Analysis for a Higher-Order Language
- Gomez, Liu
- 2002
(Show Context)
Citation Context ...r-order functions and side eects. The extension to higher-order functions should be similar to the recent extension of timing analysis by Gomez and Liu fromsrst-order [34] to higher-order functions [1=-=5-=-]. The extension to handle side eects in the presence of destructive update is more complicated, since using reference counting may give overly pessimistic bounds when cycles are present. Since we hav... |

20 |
A backwards analysis for compile-time garbage collection
- Jensen, Mogensen
(Show Context)
Citation Context |

19 |
Computer-Assisted Microanalysis of Programs
- Cohen
- 1982
(Show Context)
Citation Context ...]. The analysis is mainly asymptotic. A theoretically challenging problem that arises in this approach is optimizing the time-bound or space-bound function to a closed form in terms of the input size =-=[53, 5, 32, 45, 12]-=-. Although much progress has been made in this area, closed forms are known only for subclasses of functions. Thus, such optimization can not be automatically done for analyzing general programs. Rose... |

19 | Order-of-evaluation analysis for destructive updates in strict functional languages with flat aggregates
- Sastry, Clinger, et al.
- 1993
(Show Context)
Citation Context |

16 | Copy Elimination in Functional Languages
- Gopinath, Hennessy
- 1989
(Show Context)
Citation Context |

15 | Live memory analysis for garbage collection in embedded systems
- Persson
- 1999
(Show Context)
Citation Context ...or reactive systems, and interactive systems. In particular, space analysis is becoming increasingly important due to the increasing uses of high-level languages with garbage collection, such as Java =-=[40]-=-, the importance of cache memories in performance [54], and the stringent space requirements in the ever-growing area of embedded applications [46]. For example, space analysis is needed to verify tha... |

15 |
The Automatic Complexity Analysis of Divide-and-Conquer Programs
- Zimmermann, Zimmermann
- 1989
(Show Context)
Citation Context ...onal analysis of the time and space complexity of algorithms, inputs are characterized by their size. Accommodating this requires manual or semi-automatic transformation of the time or space function =-=[53, 32, 55]-=-. The analysis is mainly asymptotic. A theoretically challenging problem that arises in this approach is optimizing the time-bound or space-bound function to a closed form in terms of the input size [... |

14 |
Resource Bound Certi
- Crary, Weirich
- 2000
(Show Context)
Citation Context |

14 | Lambda-Upsilon-Omega: An assistant algorithms analyzer
- Flajolet, Salvy, et al.
- 1989
(Show Context)
Citation Context |

14 |
Compile-time garbage collection for higher-order functional languages
- Hughes
- 1992
(Show Context)
Citation Context |

14 | Set constraints for destructive array update optimization
- Wand, Clinger
(Show Context)
Citation Context |

10 |
A powerful strategy for deriving efficient programs by transformation
- Pettorossi
- 1984
(Show Context)
Citation Context ...expressions evaluates S [ [e 1 ] ] and e 1 separately. This causes redundancy that can increase the running time of the transformed program by an exponential factor. This is easily avoided by tupling =-=[41]-=-; specifically, the transformation is modified so that S [ [e]] return a pair containing the return value of e and a frame count vector. With this optimization, the asymptotic time complexity of the t... |

8 | R.: A New Solution to the Hidden Copy Problem
- Goyal, Paige
- 1998
(Show Context)
Citation Context ...he input. Also, they do not compute the size of live space. Our analysis combines static program analysis techniques with reference counting and is simple and powerful. Interestingly, Goyal and Paige =-=[17]-=- developed a method for avoiding unnecessary hidden copies by performing compile-time analysis and optimizations that facilitate dynamic reference counting; their method is also simple and powerful, c... |

7 |
Compile-time garbage collection by necessity analysis
- Hamilton, Jones
- 1990
(Show Context)
Citation Context |

6 |
E ectiveness of trace sampling for performance debugging tools
- Martonosi, Gupta, et al.
- 1993
(Show Context)
Citation Context ...sis and systems. The former is in terms of asymptotic space complexity in closed forms [30]. The latter is mostly in the form of tracing memory behavior or analyzing cache eects at the machine level [=-=36, 54]-=-. What has been lacking is analysis of stack space and heap space for high-level languages, in particular, automatic and accurate techniques for live heap space analysis for languages with garbage col... |