Layout Transformations for Heap Objects Using Static Access Patterns

  • Jinseong Jeon
  • Keoncheol Shin
  • Hwansoo Han
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4420)


As the amount of data used by programs increases due to the growth of hardware storage capacity and computing power, efficient memory usage becomes a key factor for performance. Since modern applications heavily use structures allocated in the heap, this paper proposes an efficient structure layout based on static analyses. Unlike most of the previous work, our approach is an entirely static transformation of programs. We extract access patterns from source programs and represent them with regular expressions. Repetitive accesses are usually important pieces of information for locality optimizations. The expressive power of regular expressions is appropriate to represent those repetitive accesses along with various access patterns according to the control flow of programs. By interpreting statically obtained access patterns, we choose suitable structures for pool allocation and reorganize field layouts of the chosen structures. To verify the effect of our static optimization, we implement our analyses and optimizations with the CIL compiler. Our experiments with the Olden benchmarks demonstrate that layout transformations for heap objects based on our static access pattern analysis improve cache locality by 38% and performance by 24%.


  1. 1.
    Seidl, M.L., Zorn, B.G.: Segregating heap objects by reference behavior and lifetime. In: ASPLOS-VIII, Oct. 1998, pp. 12–23 (1998)Google Scholar
  2. 2.
    Lattner, C., Adve, V.: Automatic pool allocation: improving performance by controlling data structure layout in the heap. In: PLDI ’05, Jun. 2005, pp. 129–142 (2005)Google Scholar
  3. 3.
    Cherem, S., Rugina, R.: Region analysis and transformation for java programs. In: ISMM ’04: International Symposium on Memory Management, Oct. 2004, pp. 85–96 (2004)Google Scholar
  4. 4.
    Shen, X., et al.: Lightweight reference affinity analysis. In: ICS ’05: International Conference on Supercomputing, pp. 131–140 (2005)Google Scholar
  5. 5.
    Zhong, Y., et al.: Array regrouping and structure splitting using whole-program reference affinity. In: PLDI ’04, pp. 255–266 (2004)Google Scholar
  6. 6.
    Chilimbi, T.M., Davidson, B., Larus, J.R.: Cache-conscious structure definition. In: PLDI ’99, May 1999, pp. 13–24 (1999)Google Scholar
  7. 7.
    Rabbah, R.M., Palem, K.V.: Data remapping for design space optimization of embedded memory systems. ACM TECS 2(2), 186–218 (2003)CrossRefGoogle Scholar
  8. 8.
    Shin, K., et al.: Restructuring field layouts for embedded memory systems. In: DATE ’06: Design, Automation and Test in Europe, Mar. 2006, pp. 937–942 (2006)Google Scholar
  9. 9.
    Tofte, M., Birkedal, L.: A region inference algorithm. ACM TOPLAS 20(4), 724–767 (1998)CrossRefGoogle Scholar
  10. 10.
    Hopcroft, J.E., Motwani, R., Ullman, J.D.: Introduction to automata theory, languages, and computation, 2nd edn. Addison-Wesley, Reading (2001)MATHGoogle Scholar
  11. 11.
    Tarjan, R.E.: A unified approach to path problems. J. ACM 28(3), 577–593 (1981)MATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Tarjan, R.E.: Fast algorithms for solving path problems. J. ACM 28(3), 594–614 (1981)MATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Bourdoncle, F.: Efficient chaotic iteration strategies with widenings. In: FMPA ’93: Formal Methods in Programming and their Applications, pp. 128–141 (1993)Google Scholar
  14. 14.
    Gloy, N., Smith, M.D.: Procedure placement using temporal-ordering information. ACM TOPLAS 21(5), 977–1027 (1999)CrossRefGoogle Scholar
  15. 15.
    Necula, G.C., et al.: CIL: Intermediate language and tools for analysis and transformation of c programs. In: Horspool, R.N. (ed.) CC 2002 and ETAPS 2002. LNCS, vol. 2304, pp. 213–228. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  16. 16.
    Rogers, A., et al.: Supporting dynamic data structures on distributed-memory machines. ACM TOPLAS 17(2), 233–263 (1995)CrossRefGoogle Scholar
  17. 17.
  18. 18.
    McGill benchmark suite,
  19. 19.
    Austin, T.M., Breach, S.E., Sohi, G.S.: Efficient detection of all pointer and array access errors. ACM SIGPLAN Notices 29(6), 290–301 (1994)CrossRefGoogle Scholar
  20. 20.
    Wheeler, D.A.: SLOCcount,
  21. 21.
    Guyer, S.Z., McKinley, K.S.: Finding your cronies: static analysis for dynamic object colocation. In: OOPSLA ’04, pp. 237–250 (2004)Google Scholar
  22. 22.
    Huang, X., et al.: The garbage collection advantage: improving program locality. In: OOPSLA ’04, pp. 69–80 (2004)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Jinseong Jeon
    • 1
  • Keoncheol Shin
    • 1
  • Hwansoo Han
    • 1
  1. 1.Division of Computer Science, Korea Advanced Institute of Science and Technology (KAIST), Daejeon 305-701Republic of Korea

Personalised recommendations