Skip to content

JavaLand 2023: "When Is Native Java With GraalVM Worthwhile for Me?"

Published on · Updated on · 4 min read
JavaLand logo

Share

Summary

  • For most users, native Java was not worthwhile at the time.
  • In the cloud, Java was more expensive than competitors like Go.
  • Native Java made Java cheaper, but it cost developer time to save operational costs.
  • Native Java sometimes didn’t work, and sometimes didn’t make business sense.
  • In my sample application, going from Spring Boot 2.7 to Quarkus reduced the startup time from 600 ms to 10 ms and the initial memory allocation from 107 MB to 6.7 MB.
  • The sweet spot was microservices on Kubernetes — we could run more pods per node there, if the applications weren’t CPU limited.
  • We should use a framework with GraalVM: Spring Boot 3, Quarkus, or Micronaut.

My slides showed why I came to this conclusion.

Logistics

Conference

JavaLand 2023 was a three-day on-site conference. It ran from March 20 through March 23, 2023; talks were scheduled for the 21st and 22nd, with an unconference on the 20th and workshops on the 23rd.

It was Germany’s biggest Java conference and had 2,412 visitors in 2023, the most ever. The German Oracle User Group (DOAG), the Association of the German Java User Groups (iJUG), and the German publisher Heise Medien organized this conference. All talks were recorded.

I spoke at JavaLand in 2021 about how Java developers should build front-ends. In 2022, I gave talks about Google’s cross-platform UI framework Flutter and data versions in Java.

Talk

My German talk “Wann lohnt sich Native Java mit GraalVM für mich?” (“When Is Native Java With GraalVM Worthwhile for Me?”) took place on Wednesday, March 22, 2023, at 14:00 local time.

Abstract

Java dominates enterprise applications. But in the cloud, Java is often more expensive than competitors like JavaScript, Python, or Go. Native Java with the GraalVM AOT (Ahead-of-Time) compilation makes Java cheaper: The resulting native Java applications start much faster and use less memory. But that doesn’t work for all Java applications, makes development & operation more complicated, and is also quite new.

When is native Java worthwhile for me? Usually talks on this topic either only highlight the advantages or only the disadvantages and give “It depends” as a recommendation.

My presentation, on the other hand, examines both the advantages and disadvantages of native Java. I explain how native Java works and when you can’t use it. And I told you specifically when native Java was worth it for you — and when not.

Who Made Me the Expert?

In the spring of 2022, I was the editor of a highly popular, six-part article series about native Java on InfoQ. I had data to back up my claims. And Java experts helped me.

Unlike some other talks, which were either pro or against GraalVM Native Image, I was neutral on it. I was the Switzerland of GraalVM talks! Which was quite fitting, as my project at the time was in Switzerland! 😃 I wasn’t selling books or training courses, and I wasn’t a developer advocate. I shared my experiences and my knowledge so you could get better projects faster!

Slides

The slides were available as a PDF. They had more content and more text than my talking slides. They were just 1.8 MB:

Download slides (PDF)

Historical note (as of March 2023): Back then, the slides were also available in their original Keynote format (36.1 MB) — with less text, but animated and with speaker notes; that file is no longer available today.

Get Started With Native Java

My guide to getting started with native Java explained how to install the tools for Spring Boot 3 and Quarkus, how to build native executables, and went into more detail on how Java and GraalVM worked.

Start with Native Java

Additional Talk Information

Demo Application

The demo application converted images to PDFs. It was available for Spring Boot 2 & 3 and Quarkus.

Check out the demo application

Other JavaLand 2023 Talks

There were some other talks about GraalVM and related topics:

  • “To InstantOn and Beyond: Java at Lightspeed!” by Grace Jansen
  • “The Next Frontier in Open Source Java Compilers: JIT-as-a-Service” by Grace Jansen
  • “GraalVM” by Stephan Rauch
  • “Schlanke Spring Boot Applikationen für die Cloud” (“Lean Spring Boot Applications for the Cloud”) by Patrick Baumgartner