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.
Supplemental Material
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Amazon Web Services, Inc. 2019. AWS Lambda. https://aws.amazon.com/lambda/Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- D.G. Bobrow, D.L. Murphy, and W. Teitelman (Eds.). 1969. The BBN Lisp System Reference Manual.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- John M. Chambers. 2008. Software for Data Analysis: Programming with R. Springer Publishing Company, Incorporated, Chapter 2.2: An Interactive Session, 13–19.Google Scholar
- Ben Corrie. 2006. Java Technology, IBM Style: Class Sharing. https://www.ibm.com/developerworks/java/library/j-ibmjava4/Google Scholar
- CRIU. 2019. Checkpoint/Restore in Userspace. https://criu.orgGoogle Scholar
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- D Language Foundation. 2019. D programming language. https://dlang.orgGoogle Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- David Ehringer. 2010. The Dalvik Virtual Machine Architecture. http://davidehringer.com/software/android/The_Dalvik_ Virtual_Machine.pdfGoogle Scholar
- A. D. Falkoff and K. E. Iverson. 1973. The Design of APL. IBM Journal of Research and Development 17, 4 (1973), 324–334. Google ScholarDigital Library
- FasterXML. 2019. Jackson. https://github.com/FasterXML/jacksonGoogle Scholar
- 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 ScholarDigital Library
- Google. 2012. V8 JavaScript Engine. http://code.google.com/p/v8/Google Scholar
- Google. 2019a. Dart Language. https://www.dartlang.org/Google Scholar
- Google. 2019b. Dart Snapshot. https://www.dartlang.org/articles/snapshots/Google Scholar
- Google Cloud Platform. 2019. Cloud Functions - Serverless Environment to Build and Connect Cloud Services. https: //cloud.google.com/functions/Google Scholar
- Yang Guo. 2015. Custom startup snapshots. https://v8.dev/blog/custom-startup-snapshotsGoogle Scholar
- Janice J. Heiss. 2005. The Multi-Tasking Virtual Machine: Building a Highly Scalable JVM. https://www.oracle.com/ technetwork/articles/java/mvm-141094.htmlGoogle Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- IBM. 2019. Cloud Functions. https://www.ibm.com/cloud/functionsGoogle Scholar
- 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 Scholar
- International Organization for Standards. 2017. ISO/IEC 14882:2017 Information technology — Programming languages — C++. International Organization for Standardization.Google Scholar
- 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 ScholarDigital Library
- Stefan Koch. 2017. The New CTFE Engine. https://dlang.org/blog/2017/04/10/the-new-ctfe-engine/Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- Morten Marquard and Bjarne Steensgaard. 1992. Partial Evaluation of an Object-Oriented Imperative Language. Master’s thesis. DIKU, University of Copenhagen.Google Scholar
- 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 ScholarDigital Library
- Microsoft Azure. 2019. Azure Functions Serverless Architecture. https://azure.microsoft.com/en-us/services/functions/Google Scholar
- Object Computing. 2019. Micronaut. http://micronaut.ioGoogle Scholar
- Oracle. 2019a. GraalVM. https://www.graalvm.org/Google Scholar
- Oracle. 2019b. Helidon. http://helidon.ioGoogle Scholar
- Perf Wiki. 2019. perf: Linux profiling with performance counters. https://perf.wiki.kernel.org/index.php/Main_PageGoogle Scholar
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 Scholar
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- RedHat. 2019. Quarkus. http://quarkus.ioGoogle Scholar
- 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 Scholar
- 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 ScholarCross Ref
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- Werner Schuster. 2011. The Essence of Google Dart: Building Applications, Snapshots, Isolates. https://www.infoq.com/ articles/google-dart/Google Scholar
- 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 ScholarDigital Library
- Yannis Smaragdakis and George Balatsouras. 2015. Pointer Analysis. Foundations and Trends in Programming Languages 2, 1 (2015), 1–69. Google ScholarDigital Library
- Shaun Smith. 2018. Announcing Oracle Functions. https://blogs.oracle.com/cloud-infrastructure/announcing-oraclefunctionsGoogle Scholar
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Sun Microsystems. 2004. Class Data Sharing. https://docs.oracle.com/javase/1.5.0/docs/guide/vm/class-data-sharing.htmlGoogle Scholar
- Warren Teitelman (Ed.). 1974. Interlisp Reference Manual.Google Scholar
- H. S. Teoh. 2017. Compile-time vs. compile-time. https://wiki.dlang.org/User:Quickfur/Compile-time_vs._compile-timeGoogle Scholar
- The Apache Software Foundation. 2019. ab - Apache HTTP server benchmarking tool. https://httpd.apache.org/docs/2.4/ programs/ab.htmlGoogle Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- James G. Wheeler. 1981. Improved Sharing of APL Workspaces and Libraries. In Proceedings of the International Conference on APL . ACM Press, 327–334. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
- Initialize once, start fast: application initialization at build time
Recommendations
Techniques and applications for guest-language safepoints
ICOOOLPS '15: Proceedings of the 10th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and SystemsSafepoints are a virtual machine mechanism that allows one thread to suspend other threads in a known state so that runtime actions can be performed without interruption and with data structures in a consistent state. Many virtual machines use ...
Java-to-JavaScript translation via structured control flow reconstruction of compiler IR
DLS '15We present an approach to cross-compile Java bytecodes to Java-Script, building on existing Java optimizing compiler technology. Static analysis determines which Java classes and methods are reachable. These are then translated to JavaScript using a re-...
Truffle: a self-optimizing runtime system
SPLASH '12: Proceedings of the 3rd annual conference on Systems, programming, and applications: software for humanityWe present Truffle, a novel framework for implementing managed languages in Java™. The language implementer writes an AST interpreter, which is integrated in our framework that allows tree rewriting during AST interpretation. Tree rewrites incorporate ...
Comments