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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • A Practical Guide to Creating a Spring Modulith Project
  • Distributed Tracing System (Spring Cloud Sleuth + OpenZipkin)
  • Java, Spring Boot, and MongoDB: Performance Analysis and Improvements
  • Spring Boot Secured By Let's Encrypt

Trending

  • Build Software Faster With Three Simple Principles
  • Git Blame Isn’t Enough: Building Verifiable Provenance for AI-Generated Code
  • Why Incident Response Needs Memory, Not Just Intelligence
  • Event-Driven AI Systems With Kafka and Autonomous Agents

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
Jun. 23, 20 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
38.1K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

  • A Practical Guide to Creating a Spring Modulith Project
  • Distributed Tracing System (Spring Cloud Sleuth + OpenZipkin)
  • Java, Spring Boot, and MongoDB: Performance Analysis and Improvements
  • Spring Boot Secured By Let's Encrypt

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

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 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook