Table of Contents
Fetching ...

Which Part of the Heap is Useful? Improving Heap Liveness Analysis

Vini Kanvar, Uday P. Khedker

TL;DR

This work improves the scalability and efficiency of heap liveness analysis, and reduces the amount of computed heap liveness information by using deterministic automata and by minimizing the inclusion of aliased access paths in the language.

Abstract

With the growing sizes of data structures allocated in heap, understanding the actual use of heap memory is critically important for minimizing cache misses and reclaiming unused memory. A static analysis aimed at this is difficult because the heap locations are unnamed. Using allocation sites to name them creates very few distinctions making it difficult to identify allocated heap locations that are not used. Heap liveness analysis using access graphs solves this problem by (a) using a storeless model of heap memory by naming the locations with access paths, and (b) representing the unbounded sets of access paths (which are regular languages) as finite automata. We improve the scalability and efficiency of heap liveness analysis, and reduce the amount of computed heap liveness information by using deterministic automata and by minimizing the inclusion of aliased access paths in the language. Practically, our field-, flow-, context-sensitive liveness analysis on SPEC CPU2006 benchmarks scales to 36 kLoC (existing analysis scales to 10.5 kLoC) and improves efficiency even up to 99%. For some of the benchmarks, our technique shows multifold reduction in the computed liveness information, ranging from 2 to 100 times (in terms of the number of live access paths), without compromising on soundness.

Which Part of the Heap is Useful? Improving Heap Liveness Analysis

TL;DR

This work improves the scalability and efficiency of heap liveness analysis, and reduces the amount of computed heap liveness information by using deterministic automata and by minimizing the inclusion of aliased access paths in the language.

Abstract

With the growing sizes of data structures allocated in heap, understanding the actual use of heap memory is critically important for minimizing cache misses and reclaiming unused memory. A static analysis aimed at this is difficult because the heap locations are unnamed. Using allocation sites to name them creates very few distinctions making it difficult to identify allocated heap locations that are not used. Heap liveness analysis using access graphs solves this problem by (a) using a storeless model of heap memory by naming the locations with access paths, and (b) representing the unbounded sets of access paths (which are regular languages) as finite automata. We improve the scalability and efficiency of heap liveness analysis, and reduce the amount of computed heap liveness information by using deterministic automata and by minimizing the inclusion of aliased access paths in the language. Practically, our field-, flow-, context-sensitive liveness analysis on SPEC CPU2006 benchmarks scales to 36 kLoC (existing analysis scales to 10.5 kLoC) and improves efficiency even up to 99%. For some of the benchmarks, our technique shows multifold reduction in the computed liveness information, ranging from 2 to 100 times (in terms of the number of live access paths), without compromising on soundness.
Paper Structure (27 sections, 1 theorem, 5 equations, 18 figures)

This paper contains 27 sections, 1 theorem, 5 equations, 18 figures.

Key Result

Theorem 1

Let $\rho^a$ be computed in some proposed liveness graph at $\text{\em q}\xspace_a$. Let the sequence of statements between $\text{\em q}\xspace_b$ to $\text{\em q}\xspace_a$ be $\pi'$ along an execution path $\pi$. Then, for $\text{\sf T}\xspace(\pi',\pi, \rho^a)=\Sigma^b$, all access paths in $\Si

Figures (18)

  • Figure 1: Summarization of infinite number of live access paths (APs) in the existing abstraction. Each node's field label is same as its in-edge label.
  • Figure 2: Example. Execution snapshots and fixpoint computations of backward existing and proposed liveness analyses are shown. Each live node represents live access path(s) reaching it. Each node's field label is same as its in-edge label. For simplicity, aliases of the access paths are not included. Step by step working is shown in Figure \ref{['fig:summ-steps']}
  • Figure 3: Example. A live access path represents that the memory link corresponding to its last field is live.
  • Figure 4: Example. Each node represents live access path(s) reaching it. For simplicity, aliases of the access paths are not included. Each node's field label is same as its in-edge label.
  • Figure 5: Gen and Kill to compute liveness information at entry and exit of statement $\text{\em s}\xspace$. Here $\rho \in \text{\sf V}\xspace \times \text{\sf F}\xspace^*$ and $\sigma \in \text{\sf F}\xspace^*$.
  • ...and 13 more figures

Theorems & Definitions (13)

  • Example 1
  • Example 2
  • Example 3
  • Example 4
  • Example 5
  • Example 6
  • Example 7
  • Example 8
  • Example 9
  • Example 10
  • ...and 3 more