Automatic pool allocation: improving performance by controlling data structure layout in the heap

This paper describes Automatic Pool Allocation, a transformation framework that segregates distinct instances of heap-based data structures into seperate memory pools and allows heuristics to be used to partially control the internal layout of those data structures. The primary goal of this work is performance improvement, not automatic memory management, and the paper makes several new contributions. The key contribution is a new compiler algorithm for partitioning heap objects in imperative programs based on a context-sensitive pointer analysis, including a novel strategy for correct handling of indirect (and potentially unsafe) function calls. The transformation does not require type safe programs and works for the full generality of C and C++. Second, the paper describes several optimizations that exploit data structure partitioning to further improve program performance. Third, the paper evaluates how memory hierarchy behavior and overall program performance are impacted by the new transformations. Using a number of benchmarks and a few applications, we find that compilation times are extremely low, and overall running times for heap intensive programs speed up by 10-25% in many cases, about 2x in two cases, and more than 10x in two small benchmarks. Overall, we believe this work provides a new framework for optimizing pointer intensive programs by segregating and controlling the layout of heap-based data structures.

[1]  Vikram S. Adve,et al.  Transparent pointer compression for linked data structures , 2005, MSP '05.

[2]  Dinakar Dhurjati,et al.  Memory safety without garbage collection for embedded applications , 2005, TECS.

[3]  Eran Yahav,et al.  Establishing local temporal heap safety properties with applications to compile-time memory management , 2003, Sci. Comput. Program..

[4]  Vikram S. Adve,et al.  Macroscopic Data Structure Analysis and Optimization , 2005 .

[5]  Sigmund Cherem,et al.  Region analysis and transformation for Java programs , 2004, ISMM '04.

[6]  Perry Cheng,et al.  The garbage collection advantage: improving program locality , 2004, OOPSLA.

[7]  Hong-Seok Kim,et al.  Bottom-Up and Top-Down Context-Sensitive Summary-Based Pointer Analysis , 2004, SAS.

[8]  Shengchao Qin,et al.  Region inference for an object-oriented language , 2004, PLDI '04.

[9]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[10]  Amer Diwan,et al.  Connectivity-based garbage collection , 2003, OOPSLA '03.

[11]  Martin C. Rinard,et al.  Ownership types for safe region-based memory management in real-time Java , 2003, PLDI '03.

[12]  Escape Analysis for Java. Theory and Practice , 2003 .

[13]  Vikram S. Adve,et al.  Automatic pool allocation for disjoint data structures , 2003, MSP '02.

[14]  Kathryn S. McKinley,et al.  Reconsidering custom memory allocation , 2002, OOPSLA '02.

[15]  James Cheney,et al.  Cyclone: A Safe Dialect of C , 2002, USENIX Annual Technical Conference, General Track.

[16]  Martin Elsman,et al.  Combining region inference and garbage collection , 2002, PLDI '02.

[17]  James Cheney,et al.  Region-based memory management in cyclone , 2002, PLDI '02.

[18]  Donglin Liang,et al.  Efficient Computation of Parameterized Pointer Information for Interprocedural Analyses , 2001, SAS.

[19]  Robert DeLine,et al.  Enforcing high-level protocols in low-level software , 2001, PLDI '01.

[20]  Craig B. Zilles Benchmark health considered harmful , 2001, CARN.

[21]  Michael Hind,et al.  Pointer analysis: haven't we solved this problem yet? , 2001, PASTE '01.

[22]  Jian Pei,et al.  Mining frequent patterns without candidate generation , 2000, SIGMOD '00.

[23]  Manuvir Das,et al.  Unification-based pointer analysis with directional assignments , 2000, PLDI '00.

[24]  Jakob Rehof,et al.  Scalable context-sensitive flow analysis using instantiation constraints , 2000, PLDI '00.

[25]  James Gosling,et al.  The Real-Time Specification for Java , 2000, Computer.

[26]  Jong-Deok Choi,et al.  Escape analysis for Java , 1999, OOPSLA '99.

[27]  Donglin Liang,et al.  Efficient points-to analysis for whole-program analysis , 1999, ESEC/FSE-7.

[28]  James R. Larus,et al.  Cache-conscious structure layout , 1999, PLDI '99.

[29]  James R. Larus,et al.  Cache-conscious structure definition , 1999, PLDI '99.

[30]  Chandra Krintz,et al.  Cache-conscious data placement , 1998, ASPLOS VIII.

[31]  James R. Larus,et al.  Using generational garbage collection to implement cache-conscious data placement , 1998, ISMM '98.

[32]  Matthew L. Seidl,et al.  Segregating heap objects by reference behavior and lifetime , 1998, ASPLOS VIII.

[33]  Lars Birkedal,et al.  A region inference algorithm , 1998, TOPL.

[34]  Andrew Ayers,et al.  Scalable cross-module optimization , 1998, PLDI '98.

[35]  David Gay,et al.  Memory management with explicit regions , 1998, PLDI.

[36]  Rafael Dueire Lins,et al.  Garbage collection: algorithms for automatic dynamic memory management , 1996 .

[37]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[38]  Alexander Aiken,et al.  Better static memory management: improving region-based analysis of higher-order languages , 1995, PLDI '95.

[39]  Anne Rogers,et al.  Supporting dynamic data structures on distributed-memory machines , 1995, TOPL.

[40]  Mads Tofte,et al.  Implementation of the typed call-by-value λ-calculus using a stack of regions , 1994, POPL '94.

[41]  Benjamin G. Zorn,et al.  Using lifetime predictors to improve memory allocation performance , 1993, PLDI '93.

[42]  Dirk Grunwald,et al.  Customalloc: Efficient synthesized memory allocators , 1993, Softw. Pract. Exp..

[43]  David R. Hanson Fast allocation and deallocation of memory based on object lifetimes , 1990, Softw. Pract. Exp..

[44]  Daniel G. Bobrow,et al.  Combining generational and conservative garbage collection: framework and implementations , 1989, POPL '90.

[45]  Robert Courts,et al.  Improving locality of reference in a garbage-collecting memory management system , 1988, CACM.