Automatic Object Colocation Based on Read Barriers

  • Christian Wimmer
  • Hanspeter Mössenböck
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4228)

Abstract

Object colocation is an optimization that reduces memory access costs by grouping together heap objects so that their order in memory matches their access order in the program. We implemented this optimization for Sun Microsystems’ Java HotSpotTM VM. The garbage collector, which moves objects during collection, assigns consecutive addresses to connected objects and handles them as atomic units.

We use read barriers inserted by the just-in-time compiler to detect the most frequently accessed fields per class. These “hot fields” are added to so-called hot-field tables, which are then used by the garbage collector for colocation decisions. Read barriers that are no longer needed are removed in order to reduce the overhead. Our analysis is performed automatically at run time and requires no actions on the side of the programmer.

We measured the impact of object colocation on the young and the old generation of the garbage collector, as well as the difference between dynamic colocation using read barriers and a static colocation strategy where colocation decisions are done at compile time. Our measurements show that object colocation works best for the young generation using a read-barrier-based approach.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Arnold, M., Ryder, B.G.: A framework for reducing the cost of instrumented code. In: Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation, pp. 168–179. ACM Press, New York (2001)CrossRefGoogle Scholar
  2. 2.
    Blackburn, S.M., Hosking, A.L.: Barriers: friend or foe? In: Proceedings of the 4th international symposium on Memory management, pp. 143–151. ACM Press, New York (2004)CrossRefGoogle Scholar
  3. 3.
    Chilimbi, T.M., Larus, J.R.: Using generational garbage collection to implement cache-conscious data placement. In: Proceedings of the 1st international symposium on Memory management, pp. 37–48. ACM Press, New York (1998)Google Scholar
  4. 4.
    Griesemer, R., Mitrovic, S.: A compiler for the Java HotSpotTM virtual machine. In: Böszörményi, L., Gutknecht, J., Pomberger, G. (eds.) The School of Niklaus Wirth: The Art of Simplicity, pp. 133–152. dpunkt.verlag (2000)Google Scholar
  5. 5.
    Huang, X., Blackburn, S.M., McKinley, K.S., Moss, J.E.B., Wang, Z., Cheng, P.: The garbage collection advantage: improving program locality. In: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 69–80. ACM Press, New York (2004)CrossRefGoogle Scholar
  6. 6.
    Intel Corporation: IA-32 Intel Architecture Software Developer’s Manual, vol. 1: Basic Architecture, Order Number 253665-018 (2006)Google Scholar
  7. 7.
    Jones, R., Lins, R.: Garbage Collection: Algorithms for Automatic Dynamic Memory Management. John Wiley & Sons, Chichester (1996)MATHGoogle Scholar
  8. 8.
    Kotzmann, T., Mössenböck, H.: Escape analysis in the context of dynamic compilation and deoptimization. In: Proceedings of the 1st ACM/USENIX international conference on Virtual execution environments, pp. 111–120. ACM Press, New York (2005)CrossRefGoogle Scholar
  9. 9.
    Kotzmann, T., Mössenböck, H.: Reallocation and garbage collection support for scalar-replaced and stack-allocated objects. Technical report, Institute for System Software, Johannes Kepler University Linz (2006)Google Scholar
  10. 10.
    Lhoták, O., Hendren, L.: Run-time evaluation of opportunities for object inlining in Java. In: Proceedings of the 2002 joint ACM-ISCOPE conference on Java Grande, pp. 175–184. ACM Press, New York (2002)CrossRefGoogle Scholar
  11. 11.
    Pozo, R., Miller, B.: SciMark 2.0 (1999), http://math.nist.gov/scimark2/
  12. 12.
    Standard Performance Evaluation Corporation: The SPEC JVM98 Benchmarks (1998), http://www.spec.org/jvm98/
  13. 13.
    Standard Performance Evaluation Corporation: The SPEC JBB 2005, Benchmark (2005), http://www.spec.org/jbb2005/
  14. 14.
    Sun Microsystems, Inc.: Java SE 6: Mustang Snapshot Releases (2006), https://mustang.dev.java.net/
  15. 15.
    Veldema, R., Ceriel, J.H., Rutger, F.H., Henri, E.: Object combining: A new aggressive optimization for object intensive programs. In: Proceedings of the 2002 joint ACM-ISCOPE conference on Java Grande, pp. 165–174. ACM Press, New York (2002)CrossRefGoogle Scholar
  16. 16.
    Wimmer, C., Mössenböck, H.: Optimized interval splitting in a linear scan register allocator. In: Proceedings of the 1st ACM/USENIX international conference on Virtual execution environments, pp. 132–141. ACM Press, New York (2005)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Christian Wimmer
    • 1
  • Hanspeter Mössenböck
    • 1
  1. 1.Institute for System Software, Christian Doppler Laboratory for Automated Software EngineeringJohannes Kepler University LinzLinzAustria

Personalised recommendations