skip to main content
research-article
Open Access

Initialize once, start fast: application initialization at build time

Published:10 October 2019Publication History
Skip Abstract Section

Abstract

Arbitrary program extension at run time in language-based VMs, e.g., Java's dynamic class loading, comes at a startup cost: high memory footprint and slow warmup. Cloud computing amplifies the startup overhead. Microservices and serverless cloud functions lead to small, self-contained applications that are started often. Slow startup and high memory footprint directly affect the cloud hosting costs, and slow startup can also break service-level agreements. Many applications are limited to a prescribed set of pre-tested classes, i.e., use a closed-world assumption at deployment time. For such Java applications, GraalVM Native Image offers fast startup and stable performance.

GraalVM Native Image uses a novel iterative application of points-to analysis and heap snapshotting, followed by ahead-of-time compilation with an optimizing compiler. Initialization code can run at build time, i.e., executables can be tailored to a particular application configuration. Execution at run time starts with a pre-populated heap, leveraging copy-on-write memory sharing. We show that this approach improves the startup performance by up to two orders of magnitude compared to the Java HotSpot VM, while preserving peak performance. This allows Java applications to have a better startup performance than Go applications and the V8 JavaScript VM.

Skip Supplemental Material Section

Supplemental Material

a184-wimmer.webm

webm

100.3 MB

References

  1. Ole Agesen and David Ungar. 1994. Sifting out the Gold: Delivering Compact Applications from an Exploratory Objectoriented Programming Environment. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications . ACM Press, 355–370. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Istemi Ekin Akkus, Ruichuan Chen, Ivica Rimac, Manuel Stein, Klaus Satzke, Andre Beck, Paarijaat Aditya, and Volker Hilt. 2018. SAND: Towards high-performance serverless computing. In Proceedings of the USENIX Annual Technical Conference. USENIX Association, 923–935.Google ScholarGoogle Scholar
  3. Bowen Alpern, C. R. Attanasio, Anthony Cocchi, Derek Lieber, Stephen Smith, Ton Ngo, John J. Barton, Susan Flynn Hummel, Janice C. Sheperd, and Mark Mergen. 1999. Implementing Jalapeño in Java. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications . ACM Press, 314–324. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. Alpern, S. Augart, S. M. Blackburn, M. Butrico, A. Cocchi, P. Cheng, J. Dolby, S. Fink, D. Grove, M. Hind, K. S. McKinley, M. Mergen, J. E. B. Moss, T. Ngo, and V. Sarkar. 2005. The Jikes Research Virtual Machine project: Building an open-source research community. IBM Systems Journal 44, 2 (2005), 399–417. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Amazon Web Services, Inc. 2019. AWS Lambda. https://aws.amazon.com/lambda/Google ScholarGoogle Scholar
  6. Austin Armbruster, Jason Baker, Antonio Cunei, Chapman Flack, David Holmes, Filip Pizlo, Edward Pla, Marek Prochazka, and Jan Vitek. 2007. A Real-time Java Virtual Machine with Applications in Avionics. ACM Transactions on Embedded Computing Systems 7, 1 (2007), 5:1–5:49. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Faisal Aslam, Luminous Fennell, Christian Schindelhauer, Peter Thiemann, Gidon Ernst, Elmar Haussmann, Stefan Rührup, and Zastash A. Uzmi. 2010. Optimized Java Binary and Virtual Machine for Tiny Motes. In Distributed Computing in Sensor Systems . Springer-Verlag, 15–30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Edd Barrett, Carl Friedrich Bolz-Tereick, Rebecca Killick, Sarah Mount, and Laurence Tratt. 2017. Virtual Machine Warmup Blows Hot and Cold. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications . ACM Press, 52:1–52:27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jonathan Bell and Luís Pina. 2018. CROCHET: Checkpoint and Rollback via Lightweight Heap Traversal on Stock JVMs. In Proceedings of the European Conference on Object-Oriented Programming. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 17:1–17:31. Google ScholarGoogle ScholarCross RefCross Ref
  10. D.G. Bobrow, D.L. Murphy, and W. Teitelman (Eds.). 1969. The BBN Lisp System Reference Manual.Google ScholarGoogle Scholar
  11. Eric Bodden, Andreas Sewe, Jan Sinschek, Hela Oueslati, and Mira Mezini. 2011. Taming Reflection: Aiding Static Analysis in the Presence of Reflection and Custom Class Loaders. In Proceedings of the International Conference on Software Engineering . ACM Press, 241–250. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Rodrigo Bruno and Paulo Ferreira. 2016. ALMA: GC-assisted JVM Live Migration for Java Server Applications. In Proceedings of the 17th International Middleware Conference . ACM Press, 5:1–5:14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. John M. Chambers. 2008. Software for Data Analysis: Programming with R. Springer Publishing Company, Incorporated, Chapter 2.2: An Interactive Session, 13–19.Google ScholarGoogle Scholar
  14. Ben Corrie. 2006. Java Technology, IBM Style: Class Sharing. https://www.ibm.com/developerworks/java/library/j-ibmjava4/Google ScholarGoogle Scholar
  15. CRIU. 2019. Checkpoint/Restore in Userspace. https://criu.orgGoogle ScholarGoogle Scholar
  16. Grzegorz Czajkowski. 2000. Application Isolation in the Java Virtual Machine. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications . ACM Press, 354–366. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Grzegorz Czajkowski, Laurent Daynès, and Nathaniel Nystrom. 2002. Code Sharing Among Virtual Machines. In Proceedings of the European Conference on Object-Oriented Programming . Springer-Verlag, 155–177. Google ScholarGoogle ScholarCross RefCross Ref
  18. D Language Foundation. 2019. D programming language. https://dlang.orgGoogle ScholarGoogle Scholar
  19. Jeffrey Dean, Craig Chambers, and David Grove. 1994. Identifying Profitable Specialization in Object-Oriented Languages. In Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation. ACM Press, 85–96.Google ScholarGoogle Scholar
  20. David Detlefs, Christine Flood, Steve Heller, and Tony Printezis. 2004. Garbage-first Garbage Collection. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management . ACM Press, 37–48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Gabriel Dos Reis and Bjarne Stroustrup. 2010. General Constant Expressions for System Programming Languages. In Proceedings of the ACM Symposium on Applied Computing . ACM Press, 2131–2136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. David Ehringer. 2010. The Dalvik Virtual Machine Architecture. http://davidehringer.com/software/android/The_Dalvik_ Virtual_Machine.pdfGoogle ScholarGoogle Scholar
  23. A. D. Falkoff and K. E. Iverson. 1973. The Design of APL. IBM Journal of Research and Development 17, 4 (1973), 324–334. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. FasterXML. 2019. Jackson. https://github.com/FasterXML/jacksonGoogle ScholarGoogle Scholar
  25. Daniel Frampton, Stephen M. Blackburn, Perry Cheng, Robin J. Garner, David Grove, J. Eliot B. Moss, and Sergey I. Salishev. 2009. Demystifying magic: high-level low-level programming. In Proceedings of the International Conference on Virtual Execution Environments . ACM Press, 81–90. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Google. 2012. V8 JavaScript Engine. http://code.google.com/p/v8/Google ScholarGoogle Scholar
  27. Google. 2019a. Dart Language. https://www.dartlang.org/Google ScholarGoogle Scholar
  28. Google. 2019b. Dart Snapshot. https://www.dartlang.org/articles/snapshots/Google ScholarGoogle Scholar
  29. Google Cloud Platform. 2019. Cloud Functions - Serverless Environment to Build and Connect Cloud Services. https: //cloud.google.com/functions/Google ScholarGoogle Scholar
  30. Yang Guo. 2015. Custom startup snapshots. https://v8.dev/blog/custom-startup-snapshotsGoogle ScholarGoogle Scholar
  31. Janice J. Heiss. 2005. The Multi-Tasking Virtual Machine: Building a Highly Scalable JVM. https://www.oracle.com/ technetwork/articles/java/mvm-141094.htmlGoogle ScholarGoogle Scholar
  32. Michael Hind. 2001. Pointer Analysis: Haven’t We Solved This Problem Yet?. In Proceedings of the 2001 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering . ACM Press, 54–61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Urs Hölzle, Craig Chambers, and David Ungar. 1992. Debugging optimized code with dynamic deoptimization. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation . ACM Press, 32–43. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. IBM. 2019. Cloud Functions. https://www.ibm.com/cloud/functionsGoogle ScholarGoogle Scholar
  35. Daniel H. H. Ingalls. 1983. The Evolution of the Smalltalk Virtual Machine. In Smalltalk-80: Bits of History, Words of Advice, Glenn Krasner (Ed.). Addison-Wesley Longman Publishing Co., Inc., Chapter 2, 9–28.Google ScholarGoogle Scholar
  36. International Organization for Standards. 2017. ISO/IEC 14882:2017 Information technology — Programming languages — C++. International Organization for Standardization.Google ScholarGoogle Scholar
  37. Kiyokuni Kawachiya, Kazunori Ogata, Daniel Silva, Tamiya Onodera, Hideaki Komatsu, and Toshio Nakatani. 2007. Cloneable JVM: A New Approach to Start Isolated Java Applications Faster. In Proceedings of the International Conference on Virtual Execution Environments . ACM Press, 1–11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Stefan Koch. 2017. The New CTFE Engine. https://dlang.org/blog/2017/04/10/the-new-ctfe-engine/Google ScholarGoogle Scholar
  39. Davy Landman, Alexander Serebrenik, and Jurgen J. Vinju. 2017. Challenges for Static Analysis of Java Reflection: Literature Review and Empirical Study. In Proceedings of the International Conference on Software Engineering. IEEE Computer Society, 507–518. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. David Lion, Adrian Chiu, Hailong Sun, Xin Zhuang, Nikola Grcevski, and Ding Yuan. 2016. Don’t Get Caught in the Cold, Warm-up Your JVM: Understand and Eliminate JVM Warm-up Overhead in Data-Parallel Systems. In USENIX Symposium on Operating Systems Design and Implementation . USENIX Association, 383–400.Google ScholarGoogle Scholar
  41. Morten Marquard and Bjarne Steensgaard. 1992. Partial Evaluation of an Object-Oriented Imperative Language. Master’s thesis. DIKU, University of Copenhagen.Google ScholarGoogle Scholar
  42. Kevin Marquet, Alexandre Courbot, and Gilles Grimaud. 2005. Ahead of Time Deployment in ROM of a Java-OS. In Proceedings of the International Conference on Embedded Software and Systems . Springer-Verlag, 63–70. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Microsoft Azure. 2019. Azure Functions Serverless Architecture. https://azure.microsoft.com/en-us/services/functions/Google ScholarGoogle Scholar
  44. Object Computing. 2019. Micronaut. http://micronaut.ioGoogle ScholarGoogle Scholar
  45. Oracle. 2019a. GraalVM. https://www.graalvm.org/Google ScholarGoogle Scholar
  46. Oracle. 2019b. Helidon. http://helidon.ioGoogle ScholarGoogle Scholar
  47. Perf Wiki. 2019. perf: Linux profiling with performance counters. https://perf.wiki.kernel.org/index.php/Main_PageGoogle ScholarGoogle Scholar
  48. Artur Pilipenko and Oleg Pliss. 2018. Redundancy Elimination in the Presence of Split Class Initialization. In Proceedings of the International Conference on Managed Languages & Runtimes . ACM Press, 3:1–3:14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Aleksandar Prokopec, Gilles Duboscq, David Leopoldseder, and Thomas Würthinger. 2019. An Optimization-driven Incremental Inline Substitution Algorithm for Just-in-time Compilers. In Proceedings of the International Symposium on Code Generation and Optimization . IEEE Computer Society, 164–179.Google ScholarGoogle ScholarCross RefCross Ref
  50. R Core Team. 2019. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. http://www.R-project.org/Google ScholarGoogle Scholar
  51. Richard Rashid, Avadis Tevanian, Michael Young, David Golub, Robert Baron, David Black, William Bolosky, and Jonathan Chew. 1987. Machine-independent Virtual Memory Management for Paged Uniprocessor and Multiprocessor Architectures. In Proceedings of the International Conference on Architectual Support for Programming Languages and Operating Systems . IEEE Computer Society Press, 31–39. Google ScholarGoogle ScholarCross RefCross Ref
  52. Derek Rayside and Kostas Kontogiannis. 2002. Extracting Java Library Subsets for Deployment on Embedded Systems. Science of Computer Programming 45, 2-3 (2002), 245–270. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. RedHat. 2019. Quarkus. http://quarkus.ioGoogle ScholarGoogle Scholar
  54. Ian Rogers and Dave Grove. 2009. The Strength of Metacircular Virtual Machines: Jikes RVM. In Beautiful Architecture, Diomidis Spinellis and Georgios Gousios (Eds.). O’Reilly, Chapter 10.Google ScholarGoogle Scholar
  55. Barbara G. Ryder. 2003. Dimensions of Precision in Reference Analysis of Object-oriented Programming Languages. In Proceedings of the International Conference on Compiler Construction . Springer-Verlag, 126–137. Google ScholarGoogle ScholarCross RefCross Ref
  56. Ulrik Pagh Schultz. 2001. Partial Evaluation for Class-Based Object-Oriented Languages. In Proceedings of the Symposium on Programs As Data Objects . Springer-Verlag, 173–197. Google ScholarGoogle ScholarCross RefCross Ref
  57. Ulrik P. Schultz, Julia L. Lawall, and Charles Consel. 2003. Automatic Program Specialization for Java. In ACM Transactions on Programming Languages and Systems . ACM Press, 452–499. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Werner Schuster. 2011. The Essence of Google Dart: Building Applications, Snapshots, Isolates. https://www.infoq.com/ articles/google-dart/Google ScholarGoogle Scholar
  59. Amin Shali and William R. Cook. 2011. Hybrid Partial Evaluation. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications . ACM Press, 375–390. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Yannis Smaragdakis and George Balatsouras. 2015. Pointer Analysis. Foundations and Trends in Programming Languages 2, 1 (2015), 1–69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Shaun Smith. 2018. Announcing Oracle Functions. https://blogs.oracle.com/cloud-infrastructure/announcing-oraclefunctionsGoogle ScholarGoogle Scholar
  62. Manu Sridharan, Satish Chandra, Julian Dolby, Stephen J. Fink, and Eran Yahav. 2013. Aliasing in Object-Oriented Programming. Springer-Verlag, Chapter Alias Analysis for Object-oriented Programs, 196–232. Google ScholarGoogle ScholarCross RefCross Ref
  63. Lukas Stadler, Thomas Würthinger, and Hanspeter Mössenböck. 2014. Partial Escape Analysis and Scalar Replacement for Java. In Proceedings of the International Symposium on Code Generation and Optimization. ACM Press, 165–174. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. Guy L. Steele, Jr. and Richard P. Gabriel. 1993. The Evolution of Lisp. In The Second ACM SIGPLAN Conference on History of Programming Languages . ACM Press, 231–270. Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. Sun Microsystems. 2004. Class Data Sharing. https://docs.oracle.com/javase/1.5.0/docs/guide/vm/class-data-sharing.htmlGoogle ScholarGoogle Scholar
  66. Warren Teitelman (Ed.). 1974. Interlisp Reference Manual.Google ScholarGoogle Scholar
  67. H. S. Teoh. 2017. Compile-time vs. compile-time. https://wiki.dlang.org/User:Quickfur/Compile-time_vs._compile-timeGoogle ScholarGoogle Scholar
  68. The Apache Software Foundation. 2019. ab - Apache HTTP server benchmarking tool. https://httpd.apache.org/docs/2.4/ programs/ab.htmlGoogle ScholarGoogle Scholar
  69. Frank Tip, Chris Laffra, Peter F. Sweeney, and David Streeter. 1995. Practical Experience with an Application Extractor for Java. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications . ACM Press, 292–305. Google ScholarGoogle ScholarDigital LibraryDigital Library
  70. Ben L. Titzer. 2006. Virgil: Objects on the Head of a Pin. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications . ACM Press, 191–208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  71. Ben L. Titzer, Joshua Auerbach, David F. Bacon, and Jens Palsberg. 2007. The ExoVM System for Automatic VM and Application Reduction. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, 352–362. Google ScholarGoogle ScholarDigital LibraryDigital Library
  72. David Ungar. 1995. Annotating Objects for Transport to Other Worlds. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications . ACM Press, 73–87. Google ScholarGoogle ScholarDigital LibraryDigital Library
  73. James G. Wheeler. 1981. Improved Sharing of APL Workspaces and Libraries. In Proceedings of the International Conference on APL . ACM Press, 327–334. Google ScholarGoogle ScholarDigital LibraryDigital Library
  74. Christian Wimmer, Michael Haupt, Michael L. Van De Vanter, Mick Jordan, Laurent Daynès, and Douglas Simon. 2013. Maxine: An approachable virtual machine for, and in, Java. ACM Transactions on Architecture and Code Optimization 9, 4, Article 30 (2013), 24 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  75. Christian Wimmer, Vojin Jovanovic, Erik Eckstein, and Thomas Würthinger. 2017. One Compiler: Deoptimization to Optimized Code. In Proceedings of the International Conference on Compiler Construction. ACM Press, 55–64. Google ScholarGoogle ScholarDigital LibraryDigital Library
  76. Thomas Würthinger, Christian Wimmer, Christian Humer, Andreas Wöß, Lukas Stadler, Chris Seaton, Gilles Duboscq, Doug Simon, and Matthias Grimmer. 2017. Practical Partial Evaluation for High-performance Dynamic Language Runtimes. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation . ACM Press, 662–676. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Initialize once, start fast: application initialization at build time

    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 Proceedings of the ACM on Programming Languages
      Proceedings of the ACM on Programming Languages  Volume 3, Issue OOPSLA
      October 2019
      2077 pages
      EISSN:2475-1421
      DOI:10.1145/3366395
      Issue’s Table of Contents

      Copyright © 2019 Owner/Author

      This work is licensed under a Creative Commons Attribution International 4.0 License.

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 10 October 2019
      Published in pacmpl Volume 3, Issue OOPSLA

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader