skip to main content
10.1145/1065010.1065027acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

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

Published: 12 June 2005 Publication History

Abstract

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.

References

[1]
A. Aiken, M. F�hndrich, and R. Levien. Better static memory management: Improving region-based analysis of higher-order languages. In PLDI, pages 174--185, June 1995.]]
[2]
T. Austin, et al. The Pointer-intensive Benchmark Suite. www.cs.wisc.edu/~austin/ptr-dist.html+, Sept 1995.]]
[3]
A. Ayers, S. de Jong, J. Peyton, and R. Schooler. Scalable cross-module optimization. In PLDI, Montreal, June 1998.]]
[4]
D. A. Barrett and B. G. Zorn. Using lifetime predictors to improve memory allocation performance. In PLDI, pages 187--196, Albuquerque, New Mexixo, June 1993.]]
[5]
E. D. Berger, B. G. Zorn, and K. S. McKinley. Reconsidering custom memory allocation. In OOPSLA, Seattle, Washington, Nov. 2002.]]
[6]
B. Blanchet. Escape Analysis for Java(TM): Theory and Practice. TOPLAS, 25(6):713--775, Nov 2003.]]
[7]
G. Bollella and J. Gosling. The real-time specification for Java. Computer, 33(6):47--54, 2000.]]
[8]
C. Boyapati, A. Salcianu, W. Beebee, and M. Rinard. Ownership types for safe region-based memory management in real-time java. In PLDI, 2003.]]
[9]
B. Calder, K. Chandra, S. John, and T. Austin. Cache-conscious data placement. In Proc. ASPLOS-VIII, pages 139--149, San Jose, USA, 1998.]]
[10]
S. Cherem and R. Rugina. Region analysis and transformation for java programs. In 2004 Int'l Symposium On Memory Management, Vancouver, Canada, Oct. 2004.]]
[11]
T. M. Chilimbi, B. Davidson, and J. R. Larus. Cache-conscious structure definition. In PLDI'99, pages 13--24. ACM Press, 1999.]]
[12]
T. M. Chilimbi, M. D. Hill, and J. R. Larus. Cache-conscious structure layout. In PLDI'99, pages 1--12. ACM Press, 1999.]]
[13]
T. M. Chilimbi and J. R. Larus. Using generational garbage collection to implement cache-conscious data placement. ACM SIGPLAN Notices, 34(3):37--48, 1999.]]
[14]
W.-N. Chin, F. Craciun, S. Qin, and M. Rinard. Region inference for an object-oriented language. In PLDI, Washington, DC, June 2004.]]
[15]
R. Courts. Improving locality of reference in a garbage-collecting memory management system. CACM, 31(9):1128--1138, 1988.]]
[16]
M. Das. Unification-based pointer analysis with directional assignments. In PLDI, pages 35--46, 2000.]]
[17]
R. DeLine and M. F�hndrich. Enforcing high-level protocols in low-level software. In PLDI, Snowbird, UT, June 2001.]]
[18]
A. Demers, M. Weiser, B. Hayes, H. Boehm, D. Bobrow, and S. Shenker. Combining generational and conservative garbage collection: framework and implementations. In Proc. ACM POPL, pages 261--269, 1990.]]
[19]
D. Dhurjati, S. Kowshik, V. Adve, and C. Lattner. Memory safety without garbage collection for embedded applications. Transactions on Embedded Computing Systems, 4(1):73--111, Feb. 2005.]]
[20]
M. F�hndrich, J. Rehof, and M. Das. Scalable context-sensitive flow analysis using instantiation constraints. In PLDI, Vancouver, Canada, June 2000.]]
[21]
D. Gay and A. Aiken. Memory management with explicit regions. In PLDI, pages 313--323, Montreal, Canada, 1998.]]
[22]
D. Grossman, G. Morrisett, T. Jim, M. Hicks, Y. Wang, and J. Cheney. Region-based memory management in cyclone. In PLDI, June 2002.]]
[23]
D. Grunwald and B. Zorn. Customalloc: Efficient synthesized memory allocators. SP&E, 23(8):851--869, 1993.]]
[24]
N. Hallenberg, M. Elsman, and M. Tofte. Combining region inference and garbage collection. In PLDI, Berlin, Germany, June 2002.]]
[25]
J. Han, J. Pei, and Y. Yin. Mining frequent patterns without candidate generation. In SIGMOD, pages 1--12, 2000.]]
[26]
D. R. Hanson. Fast allocation and deallcoation of memory based on object lifetimes. SP&E, 20(1):5--12, Jan 1990.]]
[27]
M. Hind. Pointer analysis: haven't we solved this problem yet? In PASTE, pages 54--61. ACM Press, 2001.]]
[28]
M. Hirzel, A. Diwan, and M. Hertz. Connectivity-based garbage collection. In OOPSLA, pages 359--373, 2003.]]
[29]
X. Huang, S. Blackburn, K. McKinley, E. Moss, Z. Wang, and P. Cheng. The garbage collection advantage: improving program locality. In OOPSLA, pages 69--80, 2004.]]
[30]
T. Jim, G. Morrisett, D. Grossman, M. Hicks, J. Cheney, and Y. Wang. Cyclone: A safe dialect of C. In USENIX Annual Technical Conference, Monterey, CA, 2002.]]
[31]
R. Jones. Garbage Collection. Algorithms for Automatic Dynamic Memory Management. John Wiley & Sons, 1999.]]
[32]
C. Lattner. Macroscopic Data Structure Analysis and Optimization. PhD thesis, Computer Science Dept., University of Illinois at Urbana-Champaign, Urbana, IL, May 2005. See http://llvm.cs.uiuc.edu.]]
[33]
C. Lattner and V. Adve. Automatic Pool Allocation for Disjoint Data Structures. In MSP, Berlin, Germany, Jun 2002.]]
[34]
C. Lattner and V. Adve. LLVM: A Compilation Framework for Lifelong Program Analysis and Transformation. In CGO, San Jose, USA, Mar 2004.]]
[35]
C. Lattner and V. Adve. Transparent Pointer Compression for Linked Data Structures. In Proc. ACM Workshop on Memory System Performance, Chicago, IL, Jun 2005.]]
[36]
D. Liang and M. J. Harrold. Efficient points-to analysis for whole-program analysis. In ESEC SIGSOFT FSE, pages 199--215, 1999.]]
[37]
D. Liang and M. J. Harrold. Efficient computation of parameterized pointer information for interprocedural analysis. In SAS, July 2001.]]
[38]
E. M. Nystrom, H.-S. Kim, and W. mei W. Hwu. Bottom-up and top-down context-sensitive summary-based pointer analysis. In SAS, 2004.]]
[39]
A. Rogers, M. Carlisle, J. Reppy, and L. Hendren. Supporting dynamic data structures on distributed memory machines. TOPLAS, 17(2), Mar. 1995.]]
[40]
P. Rundberg and F. Warg. The FreeBench v1.0 Benchmark Suite. http://www.freebench.org+, Jan 2002.]]
[41]
M. L. Seidl and B. G. Zorn. Segregating heap objects by reference behavior and lifetime. In ASPLOS-VIII, pages 12--23, San Jose, USA, 1998.]]
[42]
R. Shaham, E. Yahav, E. K. Kolodner, and M. Sagiv. Establishing local temporal heap safety properties with applications to compile-time memory management. In SAS, San Diego, USA, June 2003.]]
[43]
B. Steensgaard. Points-to analysis in almost linear time. In POPL, pages 32--41, Jan 1996.]]
[44]
M. Tofte and L. Birkedal. A region inference algorithm. TOPLAS, 20(4):724--768, July 1998.]]
[45]
M. Tofte and J.-P. Talpin. Implementation of the typed call-by-value λ-calculus using a stack of regions. In POPL, pages 188--201, 1994.]]
[46]
C. B. Zilles. Benchmark health considered harmful. SIGARCH Comput. Archit. News, 29(3):4--5, 2001.]]

Cited By

View all
  • (2024)Region-Based Data Layout via Data Reuse AnalysisProceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction10.1145/3640537.3641571(49-59)Online publication date: 17-Feb-2024
  • (2024)Getting a Handle on Unmanaged MemoryProceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 310.1145/3620666.3651326(448-463)Online publication date: 27-Apr-2024
  • (2024)TrackFM: Far-out Compiler Support for a Far Memory WorldProceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 110.1145/3617232.3624856(401-419)Online publication date: 27-Apr-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
June 2005
338 pages
ISBN:1595930566
DOI:10.1145/1065010
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 40, Issue 6
    Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
    June 2005
    325 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1064978
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 June 2005

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. cache
  2. data layout
  3. pool allocation
  4. recursive data structure
  5. static analysis

Qualifiers

  • Article

Conference

PLDI05
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)65
  • Downloads (Last 6 weeks)14
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Region-Based Data Layout via Data Reuse AnalysisProceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction10.1145/3640537.3641571(49-59)Online publication date: 17-Feb-2024
  • (2024)Getting a Handle on Unmanaged MemoryProceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 310.1145/3620666.3651326(448-463)Online publication date: 27-Apr-2024
  • (2024)TrackFM: Far-out Compiler Support for a Far Memory WorldProceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 110.1145/3617232.3624856(401-419)Online publication date: 27-Apr-2024
  • (2023)Reinvent Cloud Software Stacks for Resource DisaggregationJournal of Computer Science and Technology10.1007/s11390-023-3272-038:5(949-969)Online publication date: 30-Sep-2023
  • (2022)SemSwapProceedings of the 13th ACM SIGOPS Asia-Pacific Workshop on Systems10.1145/3546591.3547531(9-17)Online publication date: 23-Aug-2022
  • (2022)Online Application Guidance for Heterogeneous Memory SystemsACM Transactions on Architecture and Code Optimization10.1145/353385519:3(1-27)Online publication date: 6-Jul-2022
  • (2022)Mitigating Information Leakage Vulnerabilities with Type-based Data Isolation2022 IEEE Symposium on Security and Privacy (SP)10.1109/SP46214.2022.9833675(1049-1065)Online publication date: May-2022
  • (2021)PredCom: A Predictive Approach to Collecting Approximated Communication TracesIEEE Transactions on Parallel and Distributed Systems10.1109/TPDS.2020.301112132:1(45-58)Online publication date: 1-Jan-2021
  • (2020)HALO: post-link heap-layout optimisationProceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization10.1145/3368826.3377914(94-106)Online publication date: 22-Feb-2020
  • (2020)Deep Learning-Based Video CodingACM Computing Surveys10.1145/336840553:1(1-35)Online publication date: 6-Feb-2020
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media