r/java • • 3h ago

Helidon on a 512 MiB VM with PostgreSQL: comparison with Spring Boot, Quarkus, Micronaut and Jex

Post image

I've added Helidon to my Java framework benchmarking project to see how it performs in a resource-constrained environment.

Frameworks tested:

  • Spring Boot 4.1.1 + Spring JDBC 7.0.9
  • Quarkus 3.40.1 + Jdbi 3.55.0 (via CoilBase 0.1.0-preview5)
  • Micronaut 5.2.11 + Data JDBC 5.2.0
  • Avaje Jex 3.6 + Jdbi 3.55.0 (via CoilBase 0.1.0-preview5)
  • Helidon 27.0.2 + Data JDBC 27.0.2

CoilBase is a small framework I'm developing. It's a thin abstraction over Jdbi with optional Jex integration that I use to simplify porting applications between Java frameworks without rewriting the persistence layer. For Helidon, I used its own Data JDBC implementation instead, as it provides comparable data access capabilities to Spring JDBC.

Benchmark setup:

  • 1 vCPU, 512 MiB RAM, no swap
  • Debian 13, OpenJDK 27 (HotSpot)
  • PostgreSQL 18.7 on the same VM
  • Sustained 100 RPS
  • Same application functionality, JVM settings and four-connection database pool

Some interesting observations from two benchmark rounds:

  • Helidon had the lowest p99 latency in both rounds (8.35-8.48 ms).
  • Peak application RSS was around 168 MiB, second-lowest behind Jex.
  • Application readiness took 5.04-5.29 seconds.
  • All five frameworks completed both runs without errors, timeouts or dropped requests.

Helidon doesn't seem to get as much attention as Quarkus or Micronaut in discussions about lightweight Java frameworks, but these results are quite interesting.

This is a fixed-load comparison, not a maximum throughput benchmark.

Detailed experiment and charts: https://pvrlabs.xyz/java-performance/experiments/helidon-27-512mib.html

Source code and benchmark methodology: https://github.com/PVRLabs/framework-benchmarks/tree/experiment-helidon/framework-benchmarks/evidence/helidon-comparison

I'm also exploring native rewrite targets to see how much further we can reduce resource usage compared to Java on HotSpot. Currently experimenting with Go, using the same application and benchmark methodology. Planning to publish the results next week.

13 Upvotes

7 comments sorted by

4

u/Distinct_Meringue_76 1h ago

I'll expect quarkus and helidon to be close latency-wise compared to the other blocking frameworks. How about throughput?

1

u/fykup 1h ago

The focus of this benchmark is resource efficiency at a sustainable workload rather than maximum throughput. I initially started at 40 RPS, then increased it to 100 RPS after further experiments: https://github.com/PVRLabs/framework-benchmarks/issues/1

All five frameworks comfortably sustained 100 RPS with CPU headroom remaining.

There's also an open issue to explore maximum throughput and saturation limits. Contributions are welcome: https://github.com/PVRLabs/framework-benchmarks/issues/2

1

u/fykup 1h ago

Fun fact: according to Datadog's recent State of Java report, 52% of Java web services handle less than 1 RPS even during their daily peak hour, and only 7% handle 100 RPS or more.

https://www.datadoghq.com/state-of-java/

1

u/Comfortable_Job8847 2h ago

what happens if you disable C2? or use OpenJ9 instead? or use SerialGC instead of G1GC? im pretty sure usig G1GC on 1 vCPU with 512MiB of RAM total is not recommended. if you don't specify G1GC explicitly doesnt the JVM even pick serialGC on those specs?

2

u/fykup 2h ago

This is exactly why I designed the framework benchmarks to be reproducible. Anyone can try different JVM settings and run the same benchmark protocol locally or through GitHub Actions:

https://github.com/PVRLabs/framework-benchmarks#try-your-own-jvm-settings

I've experimented with OpenJ9 before. It offered modest memory savings in my tests, but at the expense of slower cold startup and other trade-offs. My goal here is to stay close to mainstream HotSpot configurations.

Regarding G1, it is actually the default even on single-core, memory-constrained systems starting with JDK 27 (https://openjdk.org/jeps/523).

I've also run multiple experiments with different heap sizes and workloads. The measurements show sufficient memory and CPU headroom on the 512 MiB VM for the tested workloads.

SerialGC and disabling C2 would be interesting experiments, but the primary focus here is framework efficiency rather than JVM tuning. I'd certainly welcome contributions with alternative JVM configurations and measurements.

-1

u/Distinct_Meringue_76 1h ago

There's also a new java micro profile framework that's been vibecoded from scratch and that I've been playing with. Never thought I'll say this but I like it a lot. Will be interested to see how it fares in your benchmark. Vidocq it's called