DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • AOT Compilation Make Java More Power
  • Spring2quarkus — Spring Boot to Quarkus Migration
  • A Practical Guide to Creating a Spring Modulith Project
  • Distributed Tracing System (Spring Cloud Sleuth + OpenZipkin)

Trending

  • A Developer's Guide to Mastering Agentic AI: From Theory to Practice
  • Grafana Loki Fundamentals and Architecture
  • Unlocking AI Coding Assistants Part 1: Real-World Use Cases
  • Unlocking the Benefits of a Private API in AWS API Gateway
  1. DZone
  2. Coding
  3. Frameworks
  4. Quarkus vs Spring Boot – Performance

Quarkus vs Spring Boot – Performance

In this article, we are going to compare the Quarkus and Spring Boot applications and how they behave in terms of memory management.

By 
Shabbir Dawoodi user avatar
Shabbir Dawoodi
·
Jun. 23, 20 · Tutorial
Likes (9)
Comment
Save
Tweet
Share
37.4K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, we are going to compare the Quarkus and Spring Boot applications and how they behave in terms of memory management.

To be fair in comparison to both the applications, we will go with a standard set of dependencies. Both the application will include Spring Web dependencies only. They will be build using maven tool and jar files will be created. Both the application will have similar REST Endpoints.

quarkus vs spring boot

This comparison is going to be super crazy. We will create both applications from scratch.

Creating Quarkus Application

To create a quarkus application, go to https://code.quarkus.io/ and fill the below details.

quarkus homepage screenshot

Open this project in your preferred IDE.

Create a new class HomeController.java and add the below code in that class file.

Java
 




x
10


 
1
@RestController
2
@RequestMapping("/hello")
3
public class HomeController {
4
 
5
    @GetMapping
6
    public String hello() {
7
        return "hello";
8
    }
9
 
10
}


Now, to run this application, go to the terminal and run the below command. 

mvn clean package

Once the jar file is created, execute the below command to run the standalone jar file with the below command. 

java -jar code-with-quarkus-1.0.0.SNAPSHOT-runner.jar 

Creating a Spring Boot Application

To create a Spring Boot application, go to https://start.spring.io/ and fill the below details.

spring boot application homepage application

Open this project in your preferred IDE.

Create a new class HomeController.java and add the below code in that class file.

Java
 




xxxxxxxxxx
1
10


 
1
@RestController
2
@RequestMapping("/hello")
3
public class HomeController {
4
 
5
    @GetMapping
6
    public String hello() {
7
        return "hello";
8
    }
9
 
10
}


Now, to run this application, go to the terminal and run the below command.

mvn clean package 

Once the jar file is created, execute the below command to run the standalone jar file with the below command.

java -jar demo-0.0.1-SNAPSHOT.jar 

Comparison

Now, both the applications are running and we can compare the memory utilization by both the application using jconsole. Make sure that both the applications are running on different ports, so there are no port conflicts while starting the application

To open Jconsole, go to terminal and type jconsole command as shown in the below screenshot.

jconsole command

On executing the above command, it will open a prompt to select the process to check the resources. Below are the screenshots for selecting both Quarkus and Spring Boot applications resources.


spring boot resource

Select the appropriate processes for both the application and the new window will open to monitor those applications. 


quarkus using 27mb of memory
spring boot using 47mb of memory

The Straight forward comparison for both the application depicts that Quarkus uses way less memory while starting the application. Spring Boot is using around ~47 Mb of memory compared to Quarkus’s ~27 Mb of memory utilization.

Quarkus uses Ahead of Time compilation strategy while building the application, which gives the benefit to loading only the necessary classes which helps to start the application.

quarkus loads around 5,100 classes spring boot loads 7,100

In the above screenshot, we can see that Quarkus loads around ~5100 classes compared to ~7100 of the Spring Boot application. The comparison is too much considering that both the application has the same dependency and REST Endpoint.

Spring Boot is catching up with the support of GraalVM with the latest release. We need to wait and see in the future, how much benefit all the frameworks will get with increasing demands and use of GraalVM.

We will compare more in detail about all the other aspects of the application.

If you want to understand performance by video, click below.


Spring Framework Spring Boot application Quarkus

Opinions expressed by DZone contributors are their own.

Related

  • AOT Compilation Make Java More Power
  • Spring2quarkus — Spring Boot to Quarkus Migration
  • A Practical Guide to Creating a Spring Modulith Project
  • Distributed Tracing System (Spring Cloud Sleuth + OpenZipkin)

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!