skip to main content
10.1145/1375657.1375660acmconferencesArticle/Chapter ViewAbstractPublication PagescpsweekConference Proceedingsconference-collections
research-article

Enhanced hot spot detection heuristics for embedded java just-in-time compilers

Published:12 June 2008Publication History

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.

References

  1. Jonathan L. Schilling. The Simplest Heuristics May Be the Best in Java JIT Compilers. SIGPLAN Notices, 38(2):36--46, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle Scholar
  3. K. Kumar. When and What to Compile/Optimize in a Virtual Machine? SIGPLAN Notices, 39(3):38--45, 2004 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Sun Microsystems. White Paper "CDC: An Application Framework for Personal Mobile Devices"Google ScholarGoogle Scholar
  5. J. Gosling, B. Joy, and G. Steele. The Java Language Specification Reading, Addison-Wesley, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Aycock. A Brief History of Just-in-Time, ACM Computing Surveys, 35(2), Jun 2003 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Whaley. A Portable Sampling-based Profiler for Java Virtual Machines. Proceedings of ACM 2000 Java Grande Conference, June 2000, pp. 78--87. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. Sun Microsystems. CDC CVM, http://java.sun.com/products/cdcGoogle ScholarGoogle Scholar
  11. SPEC JVM98 Benchmarks. http://www.SPEC.org/jvm98.Google ScholarGoogle Scholar
  12. EEMBC GrinderBench Benchmarks. http://www.eembc.org.Google ScholarGoogle Scholar
  13. 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 ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. IBM. IBM Technology for Java Virtual Machine in IBM i5/OS, http://www.redbooks.ibm.com/redbooks/pdfs/sg247353.pdfGoogle ScholarGoogle Scholar
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. J. Smith and R. Nair. Virtual Machines, pages 314--316, Morgan-Kaufmann, 2005.Google ScholarGoogle Scholar

Index Terms

  1. Enhanced hot spot detection heuristics for embedded java just-in-time compilers

      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

      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!