Reducing Java Startup Time: 4 Approaches

Transcript

Application Class Data Sharing (AppCDS)

Do you want to reduce the startup and warm-up time of your Java applications from minutes to milliseconds? In this video, we will explore four approaches to making your Java services start up faster or even almost instantly. Any application uses classes for its work, and all these application classes and core JVM classes must be loaded and initialized at application start. But this process repeats with every startup. So the idea behind application class data sharing for apps is ideas. Is to avoid repeating this process every time the application starts, but to load a set of system classes and application classes once and store this data in an archive. This archive is then used as a read-only metadata by the JVM. Reading the archive is faster than loading the classes from scratch, so the startup is faster. In addition, multiple JVM processes can use the same archive. With AppCDS, you can achieve about 40% better startup. If you use Spring Boot, you can enable ahead-of-time processing, and the application startup will be faster by more than 50%. The key advantage of AppCDS is that it enables tangible startup improvement without the need for code refactoring. Project Leyden is an open JDK project under development.

Project Leyden

The project is focused on shifting some commutations and optimizations from run time to some earlier stages, for instance, training runs. Then the application will use pre-compiled code and classes during the production run, and so the startup will be faster. Project Leyden uses apps CDS, ahead-of-time compilation and other techniques of shifting computations that will enable a reuse of transformed code without breaking the compatibility with the Java platform specification. But Java is a very dynamic language. It won't allow shifting computations randomly. So the project team will work towards introducing permitted constraints to the Java platform specification. They will be weaker than closed world constraints, where more applications and can use them. The goal is to introduce full closed world constraint in the future. Early access bills of project laden are already available. I have tried them out with a Springwood application and got three times faster startup. So we are looking towards production ready builds. Graal VM native image is the technology that uses ahead-of-time compilation to perform static analysis and convert Java code into machine code at build time. As a result, a Java app is turned into a fully compiled native executable. A single executable contains pre-initialized necessary application classes, required library classes, and statically linked code from the JDK

GraalVM Native Image

The key advantages of Graal VM native image are very rapid startup in one second or less, and immediate peak performance without warmup. One consideration when using Graal VM native image, you have to provide a metadata about all cases of dynamic features used in your application in a special config file, or else the native executable may behave unexpectedly or crash during the production run. Coordinated Restore Checkpoint, or CRaC for short, is an open JDK project. It enables you to create an image of a running and warmed up Java service, save it to the file.

Coordinated Restore at Checkpoint (CRaC)

Replicate this file among cloud instances and then restore the application from the file from the moment it was posted, like a video game. This way, the application starts in several milliseconds and at peak performance. And the JIT Compiler is still there, so dynamic performance optimizations are still possible. Some considerations when using crack. The technology preserves almost the exact state of a Java application, so the snapshot may contain sensitive data. Also, CRaC is a novel technology, and it is not subject to TCK testing yet. I encourage you to try all these solutions with your application and see which fits best.

You can find links to the relevant guides in the description box below

Summary

Java application startup can be significantly accelerated using modern tools. AppCDS stores preloaded classes in a shared archive, cutting startup time by up to 50%, while Project Leyden shifts optimizations to earlier stages with ahead-of-time compilation. GraalVM Native Image creates standalone executables for sub-second startup, and CRaC restores pre-warmed application states for instant readiness. These technologies offer versatile solutions to improve efficiency and performance.

About Catherine

Java developer passionate about Spring Boot. Writer. Developer Advocate at BellSoft

Social Media

Videos
card image
Dec 18, 2025
Java 26 Preview: New JEPs and What They Mean for You

Java 26 is the next feature release that brings features for enhanced performance, security, and developer experience. This video discusses the upcoming JDK 26 release, highlighting ten JEPs including JEP 500. JEP 500 focuses on preparing developers for future restrictions on mutating final fields in Java, emphasizing their role in maintaining immutable state. This is crucial for robust programming and understanding the nuances of mutable vs immutable data, especially concerning an immutable class in java. We also touch upon the broader implications for functional programming in Java.

Videos
card image
Dec 12, 2025
Will AI Replace Developers? A Vibe Coding Reality Check 2025

Can AI replace software engineers? ChatGPT, Copilot, and LLM-powered vibe coding tools promise to automate development—but after testing them against 17 years of production experience, the answer is more nuanced than the hype suggests. Full project generation produces over-engineered code that's hard to refactor. AI assistants excel at boilerplate but fail at business logic. MCP servers solve hallucination problems but create context overload. Meanwhile, DevOps automation actually works. This breakdown separates AI capabilities from marketing promises—essential for teams integrating LLMs and copilots without compromising code quality or architectural decisions.

Further watching

Videos
card image
Nov 29, 2024
OpenJDK Projects That We Anticipate

OpenJDK is actively evolving, with projects like Leyden, Valhalla, Babylon, and Lilliput aiming to enhance Java's performance and capabilities. Leyden focuses on faster startup and warmup by reusing precompiled code, while Valhalla introduces value objects, primitive classes, and specialized generics for better memory and runtime efficiency.

Videos
card image
Dec 30, 2025
Java in 2025: LTS Release, AI on JVM, Framework Modernization

Java in 2025 isn't about headline features, it's about how production systems changed under the hood. While release notes focus on individual JEPs, the real story is how the platform, frameworks, and tooling evolved to improve stability, performance, and long-term maintainability. In this video, we look at Java from a production perspective. What does Java 25 LTS mean for teams planning to upgrade? How are memory efficiency, startup time, and observability getting better? Why do changes like Scoped Values and AOT optimizations matter beyond benchmarks? We also cover the broader ecosystem: Spring Boot 4 and Framework 7, AI on the JVM with Spring AI and LangChain4j, Kotlin's growing role in backend systems, and tooling updates that make upgrades easier. Finally, we touch on container hardening and why runtime and supply-chain decisions matter just as much as language features.

Videos
card image
Dec 24, 2025
I Solved Advent of Code 2025 in Kotlin: Here's How It Went

Every year, Advent of Code spawns thousands of solutions — but few engineers step back to see the bigger picture. This is a complete walkthrough of all 12 days from 2025, focused on engineering patterns rather than puzzle statements. We cover scalable techniques: interval math without brute force, dynamic programming, graph algorithms (JGraphT), geometry with Java AWT Polygon, and optimization problems that need constraint solvers like ojAlgo. You'll see how Java and Kotlin handle real constraints, how visualizations validate assumptions, and when to reach for libraries instead of writing everything from scratch. If you love puzzles, programming—or both—and maybe want to learn how to solve them on the JVM, this is for you.