Javalin vs. Spring Boot on 256 MB RAM: A Practical Java Experiment
Equivalent JDBC APIs with H2 and monitoring on a 256 MiB Alpine VM. Both completed the workload; Javalin started faster, used less resident memory, and left more RAM available.
Small tests around Spring Boot, packaging, startup, memory, and deployment. One concrete question, the smallest useful run, and a public record of what happened. Experiments focus on reproducible measurements and technical comparisons. Articles explore broader engineering problems and practical lessons.
Discuss results and suggest future experiments in the Java Experiments squad on daily.dev .
Equivalent JDBC APIs with H2 and monitoring on a 256 MiB Alpine VM. Both completed the workload; Javalin started faster, used less resident memory, and left more RAM available.
Two pools released 18 idle connections. PostgreSQL cgroup memory was approximately 29 MiB lower, with slower connection acquisition when traffic returned.
Equivalent JDBC apps on Java 25, measured one at a time for startup, resident memory, and CPU. Quarkus had the lowest overall median RSS; its memory use converged with Micronaut’s near the end of this single run.
A small stars app used about 90 MiB less RSS with JDBC than with JPA and Hibernate, and reached its dashboard about four seconds sooner.
Same service on a 512 MiB VM: 212 MiB as a JAR, 187 MiB on optimized HotSpot 27, 107 MiB as Oracle Native Image on JDK 25.
Turning on pgJDBC batch rewriting cut the Scriptella median from 15.995 to 9.409 seconds. Handwritten JDBC went from 11.333 to 7.290. Three runs, batch size 1000.
Two runs per library with H2, 512 MiB RAM, and no swap. MyBatis used the least median workload RSS; Jdbi was competitive on latency. Includes repository code and a separate monitored MyBatis repeat.
Three Javalin persistence implementations with H2 and monitoring. All completed 1,500 requests; median workload RSS was similar, while paging, package sizes, and application code differed.
The official extracted layout cut median Spring startup 23.3% and first-request latency 34.1% in six paired runs. Settled RSS and swap did not show a material winner.
A side-by-side JVM-mode comparison on the same 512 MB virtual machine, JDK 25, and 80 MiB heap.
A practical look at Spring Boot, compact object headers, and monitoring on a 256 MiB VPS.
A Pyronaut app with Micronaut management and Micrometer Prometheus enabled worked with StatLite's existing Micronaut target, with no StatLite code changes.
A quick comparison of fat JAR, extracted layout, and Gradle application distribution startup and first-request latency.
A short comparison of Spring Boot's extracted layout and a Jib-style exploded application layout on a constrained VM.
A short follow-up comparing RSS, process swap, workload health, and monitoring continuity under the same constrained JVM profile.
A no-swap follow-up comparing RSS, process swap, workload health, and monitoring continuity with approximately 1 GiB of RAM.
These experiments answer practical engineering questions. A run may use one environment and only a few samples; each write-up explains its method and limitations. The featured experiments are a curated starting point, selected for useful findings and a range of deployment and persistence questions. Experiments focus on reproducible measurements and technical comparisons. Articles explore broader engineering problems and practical lessons.
Source, commands, supporting files, and selected raw evidence live in the public PVR Labs experiments repository.
For longer-running experiments, StatLite provides lightweight Spring Boot and JVM monitoring without a separate Prometheus/Grafana stack.