En prestandajämförelse mellan GraalVM och JVM
Java is one of the most widely used programming languages in the world and has remained popular since the 1990s. However, its traditional runtime environment, theJava Virtual Machine (JVM) has long struggled with limitations such as slow startuptime and high resource consumption. These are issues that pose challenges in modern environments where efficiency is crucial. An alternative that has gained attention is GraalVM, which offers Ahead-of-Time (AoT) compilation and the ability togenerate optimized binary files with lower resource usage. To compare the two technologies, a Java application built with Spring Boot was executed both as a JVM application and as an AoT-compiled Native Image using GraalVM. Load tests simulating 100 to 1,000 concurrent users were performed,measuring CPU usage, memory consumption, startup time and response times. The results show that GraalVM starts over 90% faster than the JVM and uses on average 70% less memory. CPU usage was also consistently lower with GraalVM. Scalability was analyzed based on how resource consumption increased under higherload. Both JVM and GraalVM displayed relatively linear growth in resource usage asthe number of concurrent users increased. However, the difference in resource usage increased under higher loads, indicating that GraalVM scales more efficiently.Average response times were comparable, with a slight advantage for GraalVM.However, the JVM performed better in higher percentiles (P90 and P95), meaningit had fewer extremely slow responses. GraalVM appears to be an efficient alternative for modern systems where low resource consumption and fast startup are priorities. At the same time, certain adaptations are required for full compatibility, especially in older systems that uses reflection and dynamic loading.
Publication Details
- Journal
- DiVA (University of Gävle)
- Published
- 2025-01-01
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Moderna
- Högskolan i Gävle