skip to main content
research-article
Distinguished Paper

Accurate profiling in the presence of dynamic compilation

Published:23 October 2015Publication History
Skip Abstract Section

Abstract

Many profilers based on bytecode instrumentation yield wrong results in the presence of an optimizing dynamic compiler, either due to not being aware of optimizations such as stack allocation and method inlining, or due to the inserted code disrupting such optimizations. To avoid such perturbations, we present a novel technique to make any profiler implemented at the bytecode level aware of optimizations performed by the dynamic compiler. We implement our approach in a state-of-the-art Java virtual machine and demonstrate its significance with concrete profilers. We quantify the impact of escape analysis on allocation profiling, object life-time analysis, and the impact of method inlining on callsite profiling. We illustrate how our approach enables new kinds of profilers, such as a profiler for non-inlined callsites, and a testing framework for locating performance bugs in dynamic compiler implementations.

Skip Supplemental Material Section

Supplemental Material

References

  1. Arnold, M., Fink, S., Grove, D., Hind, M., Sweeney, P.: A survey of adaptive optimization in virtual machines. Proceedings of the IEEE 93(2), 449–466 (2005)Google ScholarGoogle ScholarCross RefCross Ref
  2. Arnold, M., Fink, S., Grove, D., Hind, M., Sweeney, P.F.: Adaptive optimization in the Jalapeño JVM. In: Proceedings of the 15th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications. pp. 47– 65. OOPSLA ’00, ACM (2000) Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Arnold, M., Fink, S., Sarkar, V., Sweeney, P.F.: A comparative study of static and profile-based heuristics for inlining. In: Proceedings of the ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization. pp. 52–64. DYNAMO ’00, ACM (2000) Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Arnold, M., Hind, M., Ryder, B.G.: Online feedback-directed optimization of Java. In: Proceedings of the 17th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications. pp. 111–129. OOPSLA ’02, ACM (2002) Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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. PLDI ’01, ACM (2001) Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Blackburn, S.M., Garner, R., Hoffmann, C., Khang, 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., Stefanovi´c, D., VanDrunen, T., von Dincklage, D., Wiedermann, B.: The DaCapo benchmarks: Java benchmarking development and analysis. In: Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications. pp. 169–190. OOPSLA ’06, ACM (2006) Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Blanchet, B.: Escape analysis for object-oriented languages: Application to Java. In: Proceedings of the 14th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications. pp. 20–34. OOPSLA ’99, ACM (1999) Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Blanchet, B.: Escape analysis for Java: Theory and practice. ACM Trans. Program. Lang. Syst. 25(6), 713–775 (2003) Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Burke, M.G., Choi, J.D., Fink, S., Grove, D., Hind, M., Sarkar, V., Serrano, M.J., Sreedhar, V.C., Srinivasan, H., Whaley, J.: The Jalapeño dynamic optimizing compiler for Java. In: Proceedings of the ACM 1999 Conference on Java Grande. pp. 129–141. JAVA ’99, ACM (1999) Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Choi, J.D., Gupta, M., Serrano, M., Sreedhar, V.C., Midkiff, S.: Escape analysis for Java. In: Proceedings of the 14th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications. pp. 1–19. OOPSLA ’99, ACM (1999) Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Click, C., Paleczny, M.: A simple graph-based intermediate representation. In: Papers from the 1995 ACM SIGPLAN Workshop on Intermediate Representations. pp. 35–49. IR ’95, ACM (1995) Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Detlefs, D., Agesen, O.: Inlining of virtual methods. In: Proceedings of the 13th European Conference on Object-Oriented Programming. pp. 258–278. ECOOP ’99, Springer-Verlag (1999) Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Duboscq, G., Würthinger, T., Stadler, L., Wimmer, C., Simon, D., Mössenböck, H.: An Intermediate Representation for Speculative Optimizations in a Dynamic Compiler. In: Proceedings of the 7th ACM Workshop on Virtual Machines and Intermediate Languages. pp. 1–10. VMIL ’13, ACM (2013) Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9(3), 319–349 (1987) Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Häubl, C., Wimmer, C., Mössenböck, H.: Trace transitioning and exception handling in a trace-based JIT compiler for Java. ACM Trans. Archit. Code Optim. 11(1), 6:1–6:26 (2014) Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Hazelwood, K., Grove, D.: Adaptive online context-sensitive inlining. In: Proceedings of the International Symposium on Code Generation and Optimization: Feedback-directed and Runtime Optimization. pp. 253–264. CGO ’03, IEEE Computer Society (2003) Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Hertz, M., Blackburn, S.M., Moss, J.E.B., McKinley, K.S., Stefanovi´c, D.: Generating object lifetime traces with Merlin. ACM Trans. Program. Lang. Syst. 28(3), 476–516 (2006) Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Hölzle, U., Chambers, C., Ungar, D.: Debugging optimized code with dynamic deoptimization. In: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation. pp. 32–43. PLDI ’92, ACM (1992) Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Hölzle, U., Ungar, D.: Reconciling responsiveness with performance in pure object-oriented languages. ACM Trans. Program. Lang. Syst. 18(4), 355–400 (1996) Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Kell, S., Ansaloni, D., Binder, W., Marek, L.: The JVM is not observable enough (and what to do about it). In: Proceedings of the Sixth ACM Workshop on Virtual Machines and Intermediate Languages. pp. 33–38. VMIL ’12, ACM (2012) Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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. VEE ’05, ACM (2005) Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Kotzmann, T., Mössenböck, H.: Run-Time support for optimizations based on escape analysis. In: Proceedings of the International Symposium on Code Generation and Optimization. pp. 49–60. CGO ’07, IEEE Computer Society (2007) Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Li, W.H., Singer, J., White, D.: JVM-Hosted Languages: They talk the talk, but do they walk the walk? In: Proc. Intl. conf. on Principles and Practices of Programming on the Java platform:Virtual machines, languages, and tools. pp. 101–112. PPPJ ’13, ACM (2013) Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Libiˇc, P., Bulej, L., Horky, V., T˚uma, P.: On the limits of modeling generational garbage collector performance. In: Proceedings of the 5th ACM/SPEC International Conference on Performance Engineering. pp. 15–26. ICPE ’14, ACM (2014) Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Marek, L., Zheng, Y., Ansaloni, D., Bulej, L., Sarimbekov, A., Binder, W., Tuma, P.: Introduction to dynamic program analysis with DiSL. Sci. Comput. Program. 98, 100–115 (2015)Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Marek, L., Villazón, A., Zheng, Y., Ansaloni, D., Binder, W., Qi, Z.: DiSL: A domain-specific language for bytecode instrumentation. In: Proceedings of the 11th Annual International Conference on Aspect-oriented Software Development. pp. 239–250. AOSD ’12, ACM (2012) Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Mytkowicz, T., Diwan, A., Hauswirth, M., Sweeney, P.F.: Evaluating the accuracy of Java profilers. In: Proceedings of the 2010 ACM SIGPLAN Conference on Programming Language Design and Implementation. pp. 187–197. PLDI ’10, ACM (2010) Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. OpenJDK: Graal project. http://openjdk.java.net/projects/ graal/Google ScholarGoogle Scholar
  29. Oracle: hprof. http://docs.oracle.com/javase/8/docs/ technotes/samples/hprof.htmlGoogle ScholarGoogle Scholar
  30. Oracle: Netbeans profiler. https://profiler.netbeans.orgGoogle ScholarGoogle Scholar
  31. Ricci, N.P., Guyer, S.Z., Moss, J.E.B.: Elephant Tracks: Portable production of complete and precise GC traces. In: Proceedings of the 2013 International Symposium on Memory Management. pp. 109–118. ISMM ’13, ACM (2013) Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Sarimbekov, A., Stadler, L., Bulej, L., Sewe, A., Podzimek, A., Zheng, Y., Binder, W.: Workload Characterization of JVM Languages. Software: Practice and Experience (2015), http: //dx.doi.org/10.1002/spe.2337Google ScholarGoogle Scholar
  33. Sewe, A., Mezini, M., Sarimbekov, A., Ansaloni, D., Binder, W., Ricci, N., Guyer, S.Z.: new Scala() instance of Java: a comparison of the memory behaviour of Java and Scala programs. In: Proc. Intl. symp. on Memory Management. pp. 97–108. ISMM ’12, ACM (2012) Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Sewe, A., Mezini, M., Sarimbekov, A., Binder, W.: Da Capo con Scala: design and analysis of a Scala benchmark suite for the Java virtual machine. In: Proceedings of the 2011 ACM International Conference on Object Oriented Programming Systems Languages and Applications. pp. 657–676. OOPSLA ’11, ACM (2011) Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Simon, D., Wimmer, C., Urban, B., Duboscq, G., Stadler, L., Würthinger, T.: Snippets: Taking the high road to a low level. ACM Trans. Archit. Code Optim. 12(2), 20:20:1–20:20:25 (2015) Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Smith, M.D.: Overcoming the challenges to feedback-directed optimization (keynote talk). In: Proceedings of the ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization. pp. 1–11. DYNAMO ’00, ACM (2000) Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Stadler, L., Würthinger, T., Mössenböck, H.: Partial escape analysis and scalar replacement for Java. In: Proceedings of Annual IEEE/ACM International Symposium on Code Generation and Optimization. pp. 165:165–165:174. CGO ’14, ACM (2014) Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. ej technologies: JProfiler. https://www.ej-technologies.com/ products/jprofiler/overview.htmlGoogle ScholarGoogle Scholar
  39. The Eclipse Foundation: eclipse tptp. https://eclipse.org/ tptp/Google ScholarGoogle Scholar
  40. Xu, G.: Resurrector: A tunable object lifetime profiling technique for optimizing real-world programs. In: Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages and Applications. pp. 111–130. OOPSLA ’13, ACM (2013) Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Accurate profiling in the presence of dynamic compilation

      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 50, Issue 10
        OOPSLA '15
        October 2015
        953 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2858965
        • Editor:
        • Andy Gill
        Issue’s Table of Contents
        • cover image ACM Conferences
          OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
          October 2015
          953 pages
          ISBN:9781450336895
          DOI:10.1145/2814270

        Copyright © 2015 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 23 October 2015

        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!