Address Chain: Profiling Java Objects without Overhead in Java Heaps

  • Xiaohua Shi
  • Junru Xie
  • Hengyang Yu
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8858)


How to efficiently and adequately profile Java objects is one of the key problems for debugging, monitoring, program analysis, and many optimizations. Most current approaches have extra overheads in Java heaps and slow down the runtime performance significantly, or need to modify particular object layouts with limited extendibility and adaptivity. In this paper, we present a novel profiling mechanism, namely Address Chain, which has no overhead in Java heaps and does not modify object layouts, class layouts and any other key structures in Java Virtual Machines. So far, the Address Chain mechanism profiles the accurate life cycle, the allocation site in jitted code, as well as the physical memory trace of object movements with time stamps, etc., for every Java object. Furthermore, it provides a profiling framework that can be easily adapted to profile more or less information for future requirements. It is a general mechanism suitable for garbage collectors using mark-and-sweep, copying or generational algorithms. The runtime overheads of our approach are reasonable. We implemented our mechanism on Apache Harmony 6.0 DRLVM, which is a J2SE Virtual Machine with a generational garbage collector. The runtime overheads of the profiler are about 5% on average for SpecJVM2008, less than 8% for SpecJBB2005, and about 8% for Dacapo, respectively. We use a distributed mode to collect and calculate the object information from the profiled data sent via network. For most cases we studied, the object status can be calculated almost simultaneously when Java applications run on another computing device. Our mechanism has the capability of providing online object status in a distributed way. We also demonstrate how to use the profiled data to help optimizations like pretenuring.


Profiling Garbage Collector Java Virtual Machine 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
  2. 2.
    Blackburn, S.M., Garner, R., Hoffman, C., Khan, A.M., McKinley, K.S., Bentzur, R., Diwan, A., Feinberg, D., Frampton, D., Guyer, S.Z., Hirzel, M., Hosking, A., Jump, M., Lee, H., Moss, J.E.B., Phansalkar, A., Stefanovic, D., Van Drunen, T., von Dincklage, D., Wiedermann, B.: The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In: OOPSLA 2006: Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications, Portland, USA, October 22-26 (2006)Google Scholar
  3. 3.
    Blackburn, S.M., Hertz, M., McKinley, K.S., Moss, J.E.B., Yang, T.: Profile-Based Pretenuring. ACM Transactions on Programming Languages and Systems 29(1) (2007)Google Scholar
  4. 4.
    Bond, M.D., McKinley, K.S.: Leak Pruning. In: Proceedings of ASPLOS 2009, Washington, DC, USA (2009)Google Scholar
  5. 5.
    Bond, M.D., McKinley, K.S.: Bell: Bit-Encoding Online Memory Leak Detection. In: Proceedings of ASPLOS 2006, San Jose, California, USA (2006)Google Scholar
  6. 6.
    Chilimbi, T.M., Hauswirth, M.: Low-Overhead Memory Leak Detection Using Adaptive Statistical Profiling. In: Proceedings of ASPLOS 2004, Boston, MA, USA (2004)Google Scholar
  7. 7.
    Ha, J., Arnold, M., Blackburn, S.M.: A Concurrent Dynamic Analysis Framework for Multicore Hardware. In: Proceedings of OOPSLA 2009, Orlando, Florida, USA (2009)Google Scholar
  8. 8.
    Hertz, M., Blackburn, S.M., Moss, J.E.B., McKinley, K.S., Stefanovic, D.: Error-free garbage collection traces: How to cheat and not get caught. In: Proceedings of the International Conference on Measurement and Modeling of Computer Systems, Marina Del Rey, CA, USA (2002)Google Scholar
  9. 9.
    Hertz, M., Blackburn, S.M., Moss, J.E.B., McKinley, K.S., Stefanovic, D.: Generating object lifetime traces with Merlin. ACM Transactions on Programming Languages and Systems (TOPLAS) 28(3), 476–516 (2006)CrossRefGoogle Scholar
  10. 10.
    Jump, M., Blackburn, S.M., McKinley, K.S.: Dynamic object sampling for pretenuring. In: Proceedings of the 4th International Symposium on Memory Management, pp. 152–162 (2004)Google Scholar
  11. 11.
  12. 12.
  13. 13.
    Odaira, R., Ogata, K., Kawachiya, K., Onodera, T., Nakatani, T.: Efficient Runtime Tracking of Allocation Sites in Java. In: Proceedings of VEE 2010, Pittsburgh, Pennsylvania, USA (2010)Google Scholar
  14. 14.
    Odaira, R., Nakatani, T.: Continuous object access profiling and optimizations to overcome the memory wall and bloat. In: Proceedings of ASPLOS XVII, London, England, UK (2012)Google Scholar
  15. 15.
    Shaham, R., Kolodner, E.K., Sagiv, M.: Heap profiling for space-efficient Java. In: Proceedings of PLDI 2001, pp. 104–113 (2001)Google Scholar
  16. 16.
    Sun, Q.Y., Shi, X.H., Xie, J.R.: Profiling Object Life Ranges for Detecting Memory Leaks in Java Virtual Machine. In: Proceedings of PDCAT 2012, Beijing, China (2012)Google Scholar
  17. 17.
    Xu, G., Arnold, M., Mitchell, N., Rountev, A., Sevitsky, G.: Go with the Flow: Profiling Copies To Find Runtime Bloat. In: Proceedings of PLDI 2009, Dublin, Ireland (2009)Google Scholar
  18. 18.
    Xu, G.: Resurrector: A Tunable Object Lifetime Profiling Technique for Optimizing Real-World Programs. In: Proceedings of OOPSLA 2013, Indianapolis, Indiana, USA (2013)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Xiaohua Shi
    • 1
  • Junru Xie
    • 1
  • Hengyang Yu
    • 1
  1. 1.School of Computer Science and EngineeringBeihang UniversityBeijingChina

Personalised recommendations