skip to main content
research-article

Efficient runtime tracking of allocation sites in Java

Published:17 March 2010Publication History
Skip Abstract Section

Abstract

Tracking the allocation site of every object at runtime is useful for reliable, optimized Java. To be used in production environments, the tracking must be accurate with minimal speed loss. Previous approaches suffer from performance degradation due to the additional field added to each object or track the allocation sites only probabilistically. We propose two novel approaches to track the allocation sites of every object in Java with only a 1.0% slow-down on average. Our first approach, the Allocation-Site-as-a-Hash-code (ASH) Tracker, encodes the allocation site ID of an object into the hash code field of its header by regarding the ID as part of the hash code. ASH Tracker avoids an excessive increase in hash code collisions by dynamically shrinking the bit-length of the ID as more and more objects are allocated at that site. For those Java VMs without the hash code field, our second approach, the Allocation-Site-via-a-Class-pointer (ASC) Tracker, makes the class pointer field in an object header refer to the allocation site structure of the object, which in turn points to the actual class structure. ASC Tracker mitigates the indirection overhead by constant-class-field duplication and allocation-site equality checks. While a previous approach of adding a 4-byte field caused up to 14.4% and an average 5% slowdown, both ASH and ASC Trackers incur at most a 2.0% and an average 1.0% loss. We demonstrate the usefulness of our low-overhead trackers by an allocation-site-aware memory leak detector and allocation-site-based pretenuring in generational GC. Our pretenuring achieved on average 1.8% and up to 11.8% speedups in SPECjvm2008.

References

  1. Agesen, O. and Garthwaite, A. Efficient object sampling via weak references. In Proceedings of the 2nd International Symposium on Memory Management, pp. 121--126, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Bacon, D. F., Fink, S. J., and Grove, D. Space- and time-efficient implementation of the Java object model. In Proceedings of the 16th European Conference on Object-Oriented Programming, pp. 111--132, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bacon, D. F., Konuru, R., and Serrano, M. Thin locks: featherweight synchronization for Java. In Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation, pp. 258--268, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Barrett, D. A., and Zorn, B. G. Using lifetime predictors to improve memory allocation performance. In Proceedings of the ACM SIG--PLAN 1993 Conference on Programming Language Design and Im-plementation, pp. 187--196, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Blackburn, S. M., Hertz, M., McKinley, K. S., Moss, J. E. B., and Yang, T. Profile-based pretenuring. ACM Transactions on Programming Languages and Systems, vol. 29, no. 1, pp. 1--57, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Blackburn, S. M., Singhai, S., Hertz, M., McKinley, K. S., and Moss, J. E. B. Pretenuring for Java. In Proceedings of the 16th ACM SIG--PLAN Conference on Object Oriented Programming, Systems, Languages, and Applications, pp. 342--352, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bond, M. D. and Mckinley, K. S. Bell: bit-encoding online memory leak detection. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 61--72, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Chen, G., Kandemir, M., Vijaykrishnan, N., and Irwin, M. J. Field level analysis for heap space optimization in embedded java environments, In Proceedings of the 4th International Symposium on Memory Management, pp. 131--142, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Cheng, P., Harper, R., and Lee, P. Generational stack collection and profile-driven pretenuring. In Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation, pp. 162--173, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Chilimbi, T. M. and Shaham, R. Cache-conscious coallocation of hot data streams. In Proceedings of the ACM SIGPLAN 2006 Conference on Programming Language Design and Implementation, pp. 252--262, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Chilimbi, T. M. Efficient representations and abstractions for quantifying and exploiting data reference locality. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, pp. 191--202, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. DaCapo Benchmarks. http://dacapobench.org/Google ScholarGoogle Scholar
  13. Eclipse.org. http://www.eclipse.org/ .Google ScholarGoogle Scholar
  14. Grcevski, N., Kilstra, A., Stoodley, K., Stoodley, M., and Sundaresan, V. Java just-in-time compiler and virtual machine improvements for server and middleware applications. In Proceedings of the 3rd Virtual Machine Research and Technology Symposium, pp. 151--162, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Harris, T. L. Dynamic adaptive pre-tenuring. In Proceedings of the 2nd international Symposium on Memory Management, pp. 127--136, 2000, Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Hastings, R. and Joyce, B. Purify: Fast detection of memory leaks and access errors. In Proceedings of the Winter USENIX Conference, pp. 125--136, 1992.Google ScholarGoogle Scholar
  17. Hauswirth, M. and Chilimbi, T. M. Low-overhead memory leak detection using adaptive statistical profiling. In Proceedings of the 11th International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 156--164, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Huang, W., Srisa-an, W., and Chang, J. M. Dynamic pretenuring schemes for generational garbage collection. In Proceeding of the 2004 IEEE International Symposium on Performance Analysis of Systems and Software, pp. 133--140, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. IBM Java Diagnosis Guide 6. http://www.ibm.com/developerworks/java/jdk/diagnosis/ .Google ScholarGoogle Scholar
  20. Intel IA-32 Architecture Software Developer's Manual.Google ScholarGoogle Scholar
  21. Java SE 6 API Specification. http://java.sun.com/javase/6/docs/api/ .Google ScholarGoogle Scholar
  22. Java VM Specification. http://java.sun.com/docs/books/jvms/Google ScholarGoogle Scholar
  23. Jump, M., Blackburn, S. M., and Mckinley, K. S. Dynamic object sampling for pretenuring. In Proceedings of the 4th International Symposium on Memory Management, pp. 152--162, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Novark, G., Berger, E. D., and Zorn, B. G. Efficiently and precisely locating memory leaks and bloat. In Proceedings of the ACM SIG-PLAN 2009 Conference on Programming Language Design and Implementation, pp. 397--407, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Novark, G., Berger, E. D., and Zorn, B. G. Exterminator: automatically correcting memory errors with high probability. In Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation, pp. 1--11, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Novark, G., Berger, E. D., and Zorn, B. G. Plug: automatically tolerating memory leaks in C and C++ applications. Technical Report UM--CS--2008--009, University of Massachusetts, 2008.Google ScholarGoogle Scholar
  27. Qin, F., Lu, S., and Zhou, Y. SafeMem: exploiting ECC-memory for detecting memory leaks and memory corruption during production runs In Proceedings of the 2005 International Symposium on High-Performance Computer Architecture, pp. 291--302, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Seidl, M. L. and Zorn, B. G. Segregating heap objects by reference behavior and lifetime. In Proceedings of the 8th International Con--ference on Architectural Support for Programming Languages and Operating Systems, pp. 12--23, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Seward, J. and Nethercote, N. Using valgrind to detect undefined value errors with bit-precision. In Proceedings of the 2005 Annual Conference on USENIX Annual Technical Conference, pp. 17--30, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Shaham, R., Kolodner, E. K., and Sagiv, M. Heap profiling for space-efficient java. In Proceedings of the ACM SIGPLAN 2001 Confer--ence on Programming Language Design and Implementation, pp. 104--113, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Standard Performance Evaluation Corporation. SPECjbb2005. http://www.spec.org/jbb2005/ .Google ScholarGoogle Scholar
  32. Standard Performance Evaluation Corporation. SPECjvm2008. http://www.spec.org/jvm2008/ .Google ScholarGoogle Scholar
  33. Sun Microsystems. HotSpot VM. http://java.sun.com/javase/tech-nologies/hotspot/index.jspGoogle ScholarGoogle Scholar

Index Terms

  1. Efficient runtime tracking of allocation sites in Java

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

  • Published in

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 45, Issue 7
    VEE '10
    July 2010
    161 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1837854
    Issue’s Table of Contents
    • cover image ACM Conferences
      VEE '10: Proceedings of the 6th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments
      March 2010
      176 pages
      ISBN:9781605589107
      DOI:10.1145/1735997

    Copyright © 2010 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 17 March 2010

    Check for updates

    Qualifiers

    • research-article

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader
About Cookies On This Site

We use cookies to ensure that we give you the best experience on our website.

Learn more

Got it!