Starting Java faster could be worthwhile when you:
By design, Java users more time, more CPU, and more memory.
We can get Java to start faster with:
Please see my slides for why I came to this conclusion.
Additional information about the slides is below.
I will give the talk at the main office of my employer, atra.consulting, in Stuttgart.
My talk will be on November 4, 2025, at 15:00.
So können Java-Anwendungen schneller starten – sortiert nach aufsteigendem Geschwindigkeitsgewinn: Framework-Tuning, Class Data Sharing (CDS), Project Leyden/JEP 483 (ab Java 24), CRaC und GraalVM Native Image. Aber: Je schneller der Start, desto größer sind Aufwand und Beschränkungen. Das kann sich lohnen, weil die Uptime der Anwendung steigt, die Anzahl der Standby-Instanzen sinkt oder Serverless Computing billiger wird.
Der Vortrag demonstriert mit einem Spring-Boot-Beispiel-Projekt alle Optionen, erklärt Vor- und Nachteile und gibt Hinweise für die Wirtschaftlichkeitsberechnung.
This is how Java applications can start faster – sorted by ascending speed gains: Framework tuning, Class Data Sharing (CDS), Project Leyden/JEP 483 (from Java 24 onward), CRaC, and GraalVM Native Image. However: The faster the startup, the greater the effort and limitations. This can be worthwhile because application uptime increases, the number of standby instances decreases, or serverless computing becomes cheaper.
The talk demonstrates all options using a Spring Boot example project, explains pros and cons, and provides guidance for cost-benefit calculations.
In the spring of 2022, I was the editor of a highly popular, six-part article series about native Java on InfoQ. I wrote several articles about Project Leyden, CRaC, and GraalVM Native Image and gave talks about them, too.
Here are the slides as PDF. They have more content and more text than my talking slides. They are just 0.4 MB:
You can also get the slides in their original Keynote format. “Keynote” is Apple’s presentation application. Why would you do that? My slides have less text than the PDF version, so you can see what I cut. I also animated the slides, so they are more pleasant to watch. Or maybe you want to peek under the hood to see how I achieved specific effects. The slides also have fewer words than the PDF ones - it’s a talk, not a read! But they do have speaker notes. These slides are 6 MB.
The repo is a fork of the official Spring Petclinic. I added the shell scripts for building the project (compile-and-run.sh) and for the training and benchmark runs (benchmark.sh), added a small library for CRaC, and ignored some of the files. The scripts are only tested for Linux and macOS!
You can run the six benchmarks yourself with ./compile-and-run.sh [scenario], where scenario is one of these:
baseline: The baseline scenario of plain Spring Boot – option 0 in my talk. Needs JDK 25.tuning: Spring Boot tuning – option 1 in my talk. Needs JDK 25.cds: Class Data Sharing – part of option 2 in my talk. Needs JDK 25.leyden: Project Leyden – part of option 2 in my talk. Needs JDK 25.crac: Project CraC - option 3 in my talk. Needs JDK 25 from Azul with CRaC support and only works in Linux.graalvm: GraalVM Native Image – option 4 in my talk. Needs GraalVM Oracle JDK 25 and a lot of memory – 16 GB weren’t enough.The benchmark script performs three warmup runs, then seven benchmark runs. It discards the fastest and slowest benchmark run and then takes the average of the remaining five runs.
Startup time is measured in two ways:
restored JVM running for X ms in the Spring Boot log.Started PetClinicApplication in X.XXX seconds.Memory consumption is measured with running the benchmarked application through /usr/bin/time and then reading the memory from the output:
peak memory footprint from /usr/bin/time -lMaximum resident set size from /usr/bin/time -v.The script converts to KB for consistency, but displays in MB for output.
Here is the six-part article series about native Java on InfoQ from 2022. I wasn’t the author, I was the editor. The articles and news items I wrote are here.
The scenario is that a microservice Java application on Kubernetes wants to reduce operational costs. The approach is to switch to GraalVM Native Image for compilation and reduce memory consumption. This will lead to more pods fitting on a Kubernetes node, reducing the servers needed.
Here are the assumnptions:
Here are the labor costs:
Here are the operational costs:
The total cost is 46,000 Euro for labor plus 10,0080 Euro for operations, for a grand total cost of 56,080.
In order to have a positive ROI, using GraalVM Native Image needs to reduce the number Amazon EC2 T3.2XLarge servers in Kubernetes by at least six, which would reduce costs by 10,080 Euro x 6 = 60,480 Euro. That saves 4,480 Euro over three years.