Ludvig Janiuk

Direct Heap Snapshotting in the Java HotSpot VM: a Prototype

Abstract

The Java programming language is widely used across the world, powering a diverse range of technologies. However, the Java Virtual Machine suffers from long startup time and a large memory footprint. This becomes a problem when Java is used in short-lived programs such as microservices, in which the long initialization time might dominate the program runtime and even violate service level agreements. Checkpoint/Restore (C/R) is a technique which has reduced startup times for other applications, as well as reduced memory footprint. This thesis presents a prototype of a variant of C/R on the OpenJDK JVM, which saves a snapshot of the Java heap at some time during initialization. The primary goal was to see whether this was possible. The implementation successfully skips parts of initialization and the resulting program still seems to execute correctly under unit tests and test programs. It also reduces runtime by a minuscule amount under certain conditions. The portion of initialization being snapshotted would need to be further extended in order to result in larger time savings, which is a promising avenue for future work.