ABSTRACT
Most Java just-in-time compilers (JITC) try to compile only hot methods since the compilation overhead is part of the running time. This requires precise and efficient hot spot detection, which includes distinguishing hot methods from cold methods, detecting them as early as possible, and paying a small runtime overhead for detection. A hot method could be identified by measuring its running time during interpretation since a long-running method is likely to be a hot method. However, precise measurement of the running time during execution is too expensive, especially in embedded systems, so many counter-based heuristics have been proposed to estimate it. The Simple heuristic counts only method invocations without any consideration of loops [1], while Sun's HotSpot heuristic counts loop iterations as well, but does not consider loop sizes or method sizes [2,14]. The static analysis heuristic estimates the running time of a method by statically analyzing loops or heavy-cost bytecodes but does not measure their dynamic counts [3]. Although the overhead of these heuristics is low, they do not estimate the running time precisely, which may lead to imprecise hot spot detection.
This paper proposes a new hot spot detection heuristic which can estimate the running time more precisely than others with a relatively low overhead. It dynamically counts only important bytecodes interpreted, but with a simple arithmetic calculation it can obtain the precise count of all interpreted bytecodes. We also propose employing a static analysis technique to predict those hot methods which spend a huge execution time once invoked. This static prediction can allow compiling these methods at their first-invocation, complementing the proposed dynamic estimation technique. We implemented both, which led to a performance benefit of 10% compared to the HotSpot heuristic.
- Jonathan L. Schilling. The Simplest Heuristics May Be the Best in Java JIT Compilers. SIGPLAN Notices, 38(2):36--46, 2003. Google Scholar
Digital Library
- Sun Microsystems. CDC Runtime Guide for the Sun Java Connected Device Configuration Application Management System version 1.0. (Page 58), http://java.sun.com/javame/reference/docs/cdc_runtime_guide.pdf. The source code can be downloaded at http://download.java.net/mobileembedded/phoneme/advanced/phoneme_advanced-mr1-rel-src-b06-10_nov_2006.zipGoogle Scholar
- K. Kumar. When and What to Compile/Optimize in a Virtual Machine? SIGPLAN Notices, 39(3):38--45, 2004 Google Scholar
Digital Library
- Sun Microsystems. White Paper "CDC: An Application Framework for Personal Mobile Devices"Google Scholar
- J. Gosling, B. Joy, and G. Steele. The Java Language Specification Reading, Addison-Wesley, 1996. Google Scholar
Digital Library
- J. Aycock. A Brief History of Just-in-Time, ACM Computing Surveys, 35(2), Jun 2003 Google Scholar
Digital Library
- J. Whaley. A Portable Sampling-based Profiler for Java Virtual Machines. Proceedings of ACM 2000 Java Grande Conference, June 2000, pp. 78--87. Google Scholar
Digital Library
- M. Arnold, S.Fink, D. Grove, M.Hind, and P.F. Sweeney. Adaptive Optimization in the Jalapeno JVM. Proceedings of Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA) pp47--65, Oct. 2000. Google Scholar
Digital Library
- U. Holzle, C. Chambers, and D. Ungar. Debugging Optimized Code with Dynamic Deoptimization, Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, 1992. Google Scholar
Digital Library
- Sun Microsystems. CDC CVM, http://java.sun.com/products/cdcGoogle Scholar
- SPEC JVM98 Benchmarks. http://www.SPEC.org/jvm98.Google Scholar
- EEMBC GrinderBench Benchmarks. http://www.eembc.org.Google Scholar
- M. Arnold, S.J. Fink, D. Grove, M. Hind and P.F. Sweeney. A Survey of Adaptive Optimization in Virtual Machine. IBM Research Report RC23143, May 2004.Google Scholar
- M. Paleczny, C. Vick and C. Click. The Java HotSpot Server Compiler. Proceedings of the Java Virtual Machine Research and Technology Symposium (JVM '01), pages 1--12. USENIX, April 2001. Google Scholar
Digital Library
- IBM. IBM Technology for Java Virtual Machine in IBM i5/OS, http://www.redbooks.ibm.com/redbooks/pdfs/sg247353.pdfGoogle Scholar
- S. Fink and F. Qian. Design, Implementation, and Evaluation of Adaptive Recompilation with On-Stack Replacement. Proceedings of 2003 International Symposium on Code Generation and Optimization (CGO), Mar. 2003. Google Scholar
Digital Library
- J. Smith and R. Nair. Virtual Machines, pages 314--316, Morgan-Kaufmann, 2005.Google Scholar
Index Terms
Enhanced hot spot detection heuristics for embedded java just-in-time compilers
Recommendations
Enhanced hot spot detection heuristics for embedded java just-in-time compilers
LCTES '08Most Java just-in-time compilers (JITC) try to compile only hot methods since the compilation overhead is part of the running time. This requires precise and efficient hot spot detection, which includes distinguishing hot methods from cold methods, ...
Flow-sensitive runtime estimation: an enhanced hot spot detection heuristics for embedded Java just-in-time compilers
Java just-in-time compilers often compile only hot methods because the compilation overhead is a part of the running time. This requires precise and efficient hot spot detection, which includes distinguishing hot methods from cold ones, detecting them ...
Efficient exception handling in Java bytecode-to-C ahead-of-time compiler for embedded systems
One of the most promising approaches to Java acceleration in embedded systems is a bytecode-to-C ahead-of-time compiler (AOTC). It improves the performance of a Java virtual machine (JVM) by translating bytecode into C code, which is then compiled into ...







Comments