Author: Karsten Silz
Dec 2, 2022   |  updated May 9, 2023 5 min read

Permalink: https://betterprojectsfaster.com/learn/talks-jax-2023-native-java-worthwhile/

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

W-JAX logo

Summary

  • For most users, native Java is not worthwhile right now.
  • In the cloud, Java is more expensive than competitors like Go.
  • Native Java makes Java cheaper, but we’ll spend developer time to save operational costs.
  • Native Java sometimes doesn’t work, and sometimes doesn’t make business sense.
  • In my sample application, going from Spring Boot 2.7 to Quarkus 3 reduced the startup time from 640 ms to 10.4 ms and the initial memory allocation from 98 MB to 7.3 MB.
  • In the cloud, I only recommend native Java for microservices, not for monoliths or serverless.
  • In Kubernetes, we can save money by running more pods per node — if the applications aren’t CPU limited.
  • Cyberattacks like Log4Shell don’t affect native Java.
  • We should use a framework with GraalVM: Spring Boot 3, Quarkus, or Micronaut.

Please see my slides for why I came to this conclusion.

Information additional to the slides is below.

And here’s how to get started with native Java:

Table Of Contents

Logistics

Conference

JAX Hybrid 2023 is a hybrid conference in Mainz, Germany. It’s the second-largest Java conference in Germany. It will run from May 8 through May 12, 2023.

You can buy a ticket here:

Talk

My talk will be on May 9, 2023, at 12:00.

Abstract

German

Java dominiert Enterprise-Anwendungen. Aber in der Cloud ist Java oft teurer als Konkurrenten wie JavaScript, Python oder Go. Native Java durch die GraalVM AOT (Ahead-of-Time) Compilation macht Java billiger: Die entstehenden, nativen Java-Anwendungen starten viel schneller und benötigen weniger Speicher. Aber das klappt nicht für alle Java-Anwendungen, macht Entwicklung & Betrieb komplizierter und ist auch noch recht neu.

Wann lohnt sich nun Native Java für mich? Meist beleuchten Vorträge zu diesem Thema entweder nur die Vorteile oder bloß die Nachteile und geben “Kommt darauf an” als Empfehlung.

Mein Vortrag dagegen beleuchtet sowohl Vorteile als auch Nachteile von Native Java. Ich erkläre, wie Native Java funktioniert und wann Sie es nicht einsetzen können. Und ich sage Ihnen konkret, wann sich Native Java für Sie lohnt – und wann nicht.

English

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’ll tell you specifically when native Java is 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 have data to back up my claims. And Java experts helped me.

Unlike some other talks which are either pro or against GraalVM Native Image, I’m neutral on it. I’m the Switzerland of GraalVM talks! Which is quite fitting, as my current project is in Switzerland! 😃 I’m not selling books or training courses, and I’m not a developer advocate. I share my experiences and my knowledge so you can do get better projects faster!




Java Tech Popularity Index Q1/2024:
Developer job ads down 32% year over year, Stack Overflow questions dropped 55% since ChatGPT. I now recommend IntelliJ Community Edition because many AI code assistants don't run in Eclipse. Job ads for Quarkus hit an all-time high.

See All Issues & Subscribe



Slides

Here are the slides as PDF. They have more content and more text than my talking slides. They are just 2.5 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 a whoppin’ 36.4 MB.

Get Started With Native Java

Here’s my page for getting started with native Java.

  • It tells you how to install the tools for Spring Boot 3 and Quarkus and how to build native executables.
  • It explains in more detail how Java works and how GraalVM works.

Additional Talk Information

Demo Application

The demo application converts images to PDFs. It’s available for Spring Boot 2 & 3 and Quarkus. Check it out below.

The chart is from Datadog’s 2022 “The State of Serverless” report.

Java in Serverless

Here’s Holly Cummins during her Devoxx UK 2023 keynote, citing the serverless market share statistics:


Part 23 of 25 in the Conference Talks series.
« JAX London 2023: "When Is Native Java With GraalVM Worthwhile for Me?" | JAX London 2022: "Flutter for Java Developers: Mobile, Web, and Desktop with One Codebase?" » | Start: Java Forum Stuttgart 2019: "When Using the Application Generator Jhipster Is Worth It - and When Not"

Java Tech Popularity Index Q1/2024:
Developer job ads down 32% year over year, Stack Overflow questions dropped 55% since ChatGPT. I now recommend IntelliJ Community Edition because many AI code assistants don't run in Eclipse. Job ads for Quarkus hit an all-time high.

Read my newsletter


comments powered by Disqus