Custom Memory Allocation for Free

  • Alin Jula
  • Lawrence Rauchwerger
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4382)

Abstract

We present a novel and efficient container-centric memory allocator, named Defero, which allows a container to guide the allocation of its elements. The guidance is supported by the semantic-rich context of containers in which a new element is inserted. Defero allocates based on two attributes: size and location. Our policy of allocating a new object close to a related object often results in significantly increased memory reference locality. Defero has been integrated to work seamlessly with the C++ Standard Template Library (STL) containers. The communication between containers and the memory allocator is very simple and insures portability. STL container modification is the only needed code change to achieve custom memory allocation. We present experimental results that show the performance improvements that can be obtained by using Defero as a custom allocator for STL applications. We have applied our memory allocator to the molecular dynamics and compiler applications and obtained significant performance improvements over using the standard GNU STL allocator. With our approach custom memory allocation has been achieved without any modification of the actual applications, i.e., without additional programming efforts.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Barret, D., Zorn, B.: Using Lifetime Predictors to Improve Memory Allocation Performance. In: ACM SIGPLAN PLDI, Albuquerque, NM, ACM Press, New York (1993)Google Scholar
  2. 2.
    Berger, E., Zorn, B., McKinley, K.: Reconsidering Custom Memory Allocation. In: ACM OOPSLA, Seattle, WA, ACM Press, New York (2002)Google Scholar
  3. 3.
    Berger, E., Zorn, B., McKinley, K.: Composing High-Performance Memory Allocators. In: ACM SIGPLAN PLDI, Snowbird, UT, ACM Press, New York (2001)Google Scholar
  4. 4.
    Calder, B., et al.: Cache-Conscious Data Placement. In: ACM ASPLOS, San Jose, CA, ACM Press, New York (1998)Google Scholar
  5. 5.
    Chilimbi, T., Davidson, B., Larus, J.: Cache-conscious structure definition. In: ACM SIGPLAN PLDI, Atlanta, GA, ACM Press, New York (1999)Google Scholar
  6. 6.
    Chilimbi, T., Hill, M., Larus, J.: Cache-conscious structure layout. In: ACM SIGPLAN PLDI, Atlanta, GA, ACM Press, New York (1999)Google Scholar
  7. 7.
    Ding, C., Kennedy, K.: Improving cache performance in dynamic applications through data and computation reorganization at run time. In: ACM SIGPLAN PLDI, Atlanta, GA, ACM Press, New York (1999)Google Scholar
  8. 8.
    Gay, D., Aiken, A.: Memory Management with Explicit Regions. In: ACM SIGPLAN PLDI, Montreal, Canada, ACM Press, New York (1998)Google Scholar
  9. 9.
    Grunwald, D., Zorn, B.: CustoMalloc: Efficient Synthesized Memory Allocators. Technical Report CU-CS-602-92, Dept. of Computer Science, Univ. of Colorado, Boulder, CO (1992)Google Scholar
  10. 10.
    Grunwald, D., Zorn, B., Henderson, R.: Improving the Cache Locality of Memory Allocation. In: ACM SIGPLAN PLDI, Albuquerque, NM, ACM Press, New York (1993)Google Scholar
  11. 11.
    Huang, X., et al.: The garbage collection advantage: improving program locality. In: ACM OOPSLA, Vancouver, BC, Canada, ACM Press, New York (2004)Google Scholar
  12. 12.
    International Standard ISO/IEC 14882. Programming Languages C++, 1st edn. (1998)Google Scholar
  13. 13.
    Lattner, C., Adve, V.: Automatic Pool Allocation: improving performance by controlling Data Structure Layout in the Heap. In: ACM SIGPLAN PLDI, Chicago, IL, ACM Press, New York (2005)Google Scholar
  14. 14.
    Lea, D.: Some storage management techniques for container classes. The C++ Report (1990), http://g.oswego.edu/pub/papers/C++Report89.txt
  15. 15.
    Lea, D.: A memory allocator. Unix/Mail, Hanser Verlag (1996), http://gee.cs.oswego.edu/dl/html/malloc.html
  16. 16.
    Seidl, M., Zorn, B.: Segregating Heap Objects by Reference Behavior and Lifetime. In: ACM SIGPLAN PLDI, San Jose, CA, ACM Press, New York (1998)Google Scholar
  17. 17.
    SGI: SGI STL Allocator Design. http://www.sgi.com/tech/stl/alloc.html
  18. 18.
    Shuf, Y., et al.: Creating and Preserving Locality of Java Applications at Allocation and Garbage Collection Times. In: ACM OOPSLA, Seattle, WA, ACM Press, New York (2002)Google Scholar
  19. 19.
    Standish, T.: Data Structures Techniques. Addison-Wesley Press, Reading (1980)Google Scholar
  20. 20.
    Tofte, M., Talpin, J.: Region-Based Memory Management. In: Symposium on Principles of Programming Languages, Portland, OR (1994)Google Scholar
  21. 21.
    Truong, D., Bodin, F., Seznec, A.: Improving cache behavior of dynamically allocated data structures. In: Int. C. on Parallel Architectures and Compilation Techniques, Paris (1998)Google Scholar
  22. 22.
    Blume, W., et al.: Advanced Program Restructuring for High-Performance Computers with Polaris. IEEE Computer 2912, 78–82 (1996)Google Scholar
  23. 23.
    Vo, K.: Vmalloc: A General and Efficient Memory Allocator. Software Practice Experience 263, 357–374 (1996)CrossRefGoogle Scholar
  24. 24.
    Weinstock, C.: Dynamic Storage Allocation Techniques. Doctoral dissertation, Carnegie-Mellon University, Pittsburgh (April 1976)Google Scholar
  25. 25.
    Wilson, P., et al.: Dynamic storage allocation: A survey and critical review. In: Int. Workshop on Memory Management, Kinross, UK (1995)Google Scholar
  26. 26.
    Wolf, M., Lam, M.: A Data Locality Optimizing Algorithm. In: ACM SIGPLAN PLDI, Toronto, Canada, ACM Press, New York (1991)Google Scholar
  27. 27.
    Wolfe, M.: Iteration Space Tiling for Memory Hierarchies. In: SIAM Conf. on Parallel Processing for Scientific Computing, Los Angeles, CA (1987)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Alin Jula
    • 1
  • Lawrence Rauchwerger
    • 1
  1. 1.Texas A&M University , College Station, Texas 

Personalised recommendations