Initialize once, start fast: application initialization at build time

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.

[1]  Thomas Würthinger,et al.  An Optimization-Driven Incremental Inline Substitution Algorithm for Just-in-Time Compilers , 2019, 2019 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).

[2]  David Ungar,et al.  Sifting out the gold: delivering compact applications from an exploratory object-oriented programming environment , 1994, OOPSLA 1994.

[3]  Frank Tip,et al.  Practical experience with an application extractor for Java , 1999, OOPSLA '99.

[4]  Jens Palsberg,et al.  The ExoVM system for automatic VM and application reduction , 2007, PLDI '07.

[5]  Perry Cheng,et al.  Demystifying magic: high-level low-level programming , 2009, VEE '09.

[6]  James Noble,et al.  Aliasing in Object-Oriented Programming. Types, Analysis and Verification , 2013, Lecture Notes in Computer Science.

[7]  Daniel G. Bobrow,et al.  THE BBN-LISP SYSTEM , 1966 .

[8]  Toshio Nakatani,et al.  Cloneable JVM: a new approach to start isolated java applications faster , 2007, VEE '07.

[9]  James G. Wheeler Improved sharing of APL workspaces and libraries , 1981, APL '81.

[10]  Paulo Ferreira,et al.  ALMA: GC-assisted JVM Live Migration for Java Server Applications , 2016, Middleware Posters and Demos.

[11]  Barbara G. Ryder Dimensions of Precision in Reference Analysis of Object-Oriented Programming Languages , 2003, CC.

[12]  Gidon Ernst,et al.  Optimized Java Binary and Virtual Machine for Tiny Motes , 2010, DCOSS.

[13]  Ben L. Titzer Virgil: objects on the head of a pin , 2006, OOPSLA '06.

[14]  TipFrank,et al.  Practical experience with an application extractor for Java , 1999 .

[15]  Ulrik Pagh Schultz,et al.  Automatic program specialization for Java , 2000, TOPL.

[16]  Vivek Sarkar,et al.  The Jikes Research Virtual Machine project: Building an open-source research community , 2005, IBM Syst. J..

[17]  William R. Cook,et al.  Hybrid partial evaluation , 2011, OOPSLA '11.

[18]  Bowen Alpern,et al.  Implementing jalapeño in Java , 1999, OOPSLA '99.

[19]  John M. Chambers,et al.  Software for Data Analysis: Programming with R , 2008 .

[20]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[21]  Hanspeter Mössenböck,et al.  Partial Escape Analysis and Scalar Replacement for Java , 2014, CGO '14.

[22]  Bjarne Stroustrup,et al.  General constant expressions for system programming languages , 2010, SAC '10.

[23]  Guy L. Steele,et al.  The evolution of Lisp , 1993, HOPL-II.

[24]  Christian Wimmer,et al.  Practical partial evaluation for high-performance dynamic language runtimes , 2017, PLDI.

[25]  Derek Rayside,et al.  Extracting Java library subsets for deployment on embedded systems , 1999, Proceedings of the Third European Conference on Software Maintenance and Reengineering (Cat. No. PR00090).

[26]  Paarijaat Aditya,et al.  SAND: Towards High-Performance Serverless Computing , 2018, USENIX Annual Technical Conference.

[27]  Michael Hind,et al.  Pointer analysis: haven't we solved this problem yet? , 2001, PASTE '01.

[28]  Ding Yuan,et al.  Don't Get Caught in the Cold, Warm-up Your JVM: Understand and Eliminate JVM Warm-up Overhead in Data-Parallel Systems , 2016, OSDI.

[29]  David Detlefs,et al.  Garbage-first garbage collection , 2004, ISMM '04.

[30]  Kishori Sharan Class Data Sharing , 2019 .

[31]  Ulrik Pagh Schultz,et al.  Partial Evaluation for Class-Based Object-Oriented Languages , 2000, PADO.

[32]  Walter Bright,et al.  The D Programming Language , 2010 .

[33]  David L. Black,et al.  Machine-independent virtual memory management for paged uniprocessor and multiprocessor architectures , 1987, IEEE Trans. Computers.

[34]  Kevin Marquet,et al.  Ahead of Time Deployment in ROM of a Java-OS , 2005, ICESS.

[35]  A. D. Falkoff,et al.  The design of APL , 1973, APLQ.

[36]  Nathaniel Nystrom,et al.  Code Sharing among Virtual Machines , 2002, ECOOP.

[37]  Michael Haupt,et al.  Maxine: An approachable virtual machine for, and in, java , 2013, TACO.

[38]  Vojin Jovanovic,et al.  One compiler: deoptimization to optimized code , 2017, CC.

[39]  Anne Marsden,et al.  International Organization for Standardization , 2014 .

[40]  R Core Team,et al.  R: A language and environment for statistical computing. , 2014 .

[41]  Jan Vitek,et al.  A real-time Java virtual machine with applications in avionics , 2007, TECS.

[42]  David Ungar,et al.  Sifting out the gold: delivering compact applications from an exploratory object-oriented programming environment , 1994, OOPSLA '94.

[43]  Grzegorz Czajkowski,et al.  Application isolation in the Java Virtual Machine , 2000, OOPSLA '00.

[44]  Sarah Mount,et al.  Virtual machine warmup blows hot and cold , 2016, Proc. ACM Program. Lang..

[45]  Jonathan Bell,et al.  CROCHET: Checkpoint and Rollback via Lightweight Heap Traversal on Stock JVMs , 2018, ECOOP.

[46]  Alexander Serebrenik,et al.  Challenges for Static Analysis of Java Reflection - Literature Review and Empirical Study , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[47]  David M. Ungar Annotating objects for transport to other worlds , 1995, OOPSLA.

[48]  David Grove,et al.  Identifying Profitable Specialization in Object-Oriented Languages , 1994, PEPM.

[49]  Oleg Pliss,et al.  Redundancy elimination in the presence of split class initialization , 2018, ManLang '18.

[50]  Mira Mezini,et al.  Taming reflection: Aiding static analysis in the presence of reflection and custom class loaders , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[51]  Craig Chambers,et al.  Debugging optimized code with dynamic deoptimization , 1992, PLDI '92.

[52]  Warren Teitelman,et al.  The interlisp reference manual , 1974 .

[53]  Yannis Smaragdakis,et al.  Pointer Analysis , 2015, Found. Trends Program. Lang..