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.
Supplemental Material
Available for Download
The archive contains an accepted artifact, which is a virtual machine running Ubuntu Linux, packaged as a VirtualBox appliance that you need to import into VirtualBox.
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Blanchet, B.: Escape analysis for Java: Theory and practice. ACM Trans. Program. Lang. Syst. 25(6), 713–775 (2003) Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- OpenJDK: Graal project. http://openjdk.java.net/projects/ graal/Google Scholar
- Oracle: hprof. http://docs.oracle.com/javase/8/docs/ technotes/samples/hprof.htmlGoogle Scholar
- Oracle: Netbeans profiler. https://profiler.netbeans.orgGoogle Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- ej technologies: JProfiler. https://www.ej-technologies.com/ products/jprofiler/overview.htmlGoogle Scholar
- The Eclipse Foundation: eclipse tptp. https://eclipse.org/ tptp/Google Scholar
- 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 Scholar
Digital Library
Index Terms
Accurate profiling in the presence of dynamic compilation
Recommendations
Accurate profiling in the presence of dynamic compilation
OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsMany 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 ...
Platform-independent profiling in a virtual execution environment
Virtual execution environments, such as the Java virtual machine, promote platform-independent software development. However, when it comes to analyzing algorithm complexity and performance bottlenecks, available tools focus on platform-specific metrics,...
A portable and customizable profiling framework for java based on bytecode instruction counting
APLAS'05: Proceedings of the Third Asian conference on Programming Languages and SystemsPrevailing profilers for Java, which rely on standard, native-code profiling interfaces, are not portable, give imprecise results due to serious measurement perturbation, and cause excessive overheads. In contrast, program transformations allow to ...






Comments