Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Quarkus: Modernize "helloworld" JBoss EAP quickstart, Part 2

November 8, 2019
Marco Rizzi
Related topics:
JavaQuarkus

Share:

    In part one of this series, we took a detailed look at Red Hat JBoss Enterprise Application Platform (JBoss EAP) quickstarts helloworld quickstart as a starting point for understanding how to modernize a Java application using technologies (CDI and Servlet 3) supported in Quarkus. In this part, we'll continue our discussion of modernization with a look at memory consumption.

    Measuring performances is a fundamental topic when dealing with a modernization process, and memory consumption reporting is part of performance analysis. It's worth starting with these tools from the very beginning so that they can be used to evaluate the improvements achieved during the modernization process.

    A detailed introduction to measuring memory usage is available in Measuring Performance—How do we measure memory usage? Quarkus guide.

    In the following paragraphs, memory consumption data for the three different application flavors presented above (JBoss EAP, packaged JAR, and native executable) will be captured in a Linux system using pmap and ps tools.

    JBoss EAP

    Start a JBoss EAP instance by following the "Deploy helloworld" section, and retrieve its PID (e.g., 7268) using the command:

    $ pgrep -lf jboss
    7268 java
    

    Note: Add the -a option to retrieve the full command line (i.e., $ pgrep -af jboss).

    Now, the 7268 PID can be used to execute the following two commands:

    $ ps -o pid,rss,command -p 7268
    PID RSS COMMAND 
    7268 665348 java -D[Standalone] -server -verbose:gc -Xloggc:/home/mrizzi/Tools/jboss-eap-7.2.0/jboss-eap-7.2/standalone/log/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferI
    

    and:

    $ pmap -x 7268
    7268:   java -D[Standalone] -server -verbose:gc -Xloggc:/home/mrizzi/Tools/jboss-eap-7.2.0/jboss-eap-7.2/standalone/log/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/home/mrizzi/Tools/jboss-eap-7.2.0/jboss-eap-7.2/standa
    Address           Kbytes     RSS   Dirty Mode  Mapping
    00000000ae800000 1348608  435704  435704 rw---   [ anon ]
    0000000100d00000 1035264       0       0 -----   [ anon ]
    000055e4d2c2f000       4       4       0 r---- java
    000055e4d2c30000       4       4       0 r-x-- java
    000055e4d2c31000       4       0       0 r---- java
    000055e4d2c32000       4       4       4 r---- java
    000055e4d2c33000       4       4       4 rw--- java
    [...]
    ffffffffff600000       4       0       0 r-x--   [ anon ]
    ---------------- ------- ------- -------
    total kB         3263224  672772  643024
    

    Evaluating the RSS values, it looks like JBoss EAP memory consumption is around 650MB.

    Packaged JAR

    Referring to the "Run the helloworld packaged JAR" section, start the packaged JAR application by executing:

    $ java -jar ./target/helloworld-<version>-runner.jar
    

    and retrieve its PID using again the pgrep command (this time with the -a option described in the note above):

    $ pgrep -af helloworld
    6408 java -jar ./target/helloworld-<version>-runner.jar
    

    Following the same process, use the 6408 PID to evaluate memory consumption by executing:

    $ ps -o pid,rss,command -p 6408
      PID   RSS COMMAND
     6408 125732 java -jar ./target/helloworld-quarkus-runner.jar
    

    and:

    $ pmap -x 6408
    6408:   java -jar ./target/helloworld-quarkus-runner.jar
    Address           Kbytes     RSS   Dirty Mode  Mapping
    00000005d3200000  337408       0       0 rw---   [ anon ]
    00000005e7b80000 5046272       0       0 -----   [ anon ]
    000000071bb80000  168448   57576   57576 rw---   [ anon ]
    0000000726000000 2523136       0       0 -----   [ anon ]
    00000007c0000000    2176    2088    2088 rw---   [ anon ]
    00000007c0220000 1046400       0       0 -----   [ anon ]
    00005645b85d6000       4       4       0 r---- java
    00005645b85d7000       4       4       0 r-x-- java
    00005645b85d8000       4       0       0 r---- java
    00005645b85d9000       4       4       4 r---- java
    00005645b85da000       4       4       4 rw--- java
    [...]
    ffffffffff600000       4       0       0 r-x--   [ anon ]
    ---------------- ------- ------- -------
    total kB         12421844  133784  115692
    

    Evaluating the RSS values, it looks like packaged JAR memory consumption is around 130MB.

    Native executable

    In this case, following the "Run the helloworld native executable" section, the native executable application can be started with the command:

    $ ./target/helloworld-<version>-runner
    

    Its PID can be retrieved with the same command used in the previous case:

    $ pgrep -af helloworld
    6948 ./target/helloworld-<version>-runner
    

    Then, use the 6948 PID with the ps and pmap commands:

    $ ps -o pid,rss,command -p 6948
      PID   RSS COMMAND
     6948 19084 ./target/helloworld-quarkus-runner
    

    and:

    $ pmap -x 6948
    6948:   ./target/helloworld-quarkus-runner
    Address           Kbytes     RSS   Dirty Mode  Mapping
    0000000000400000      12      12       0 r---- helloworld-quarkus-runner
    0000000000403000   10736    8368       0 r-x-- helloworld-quarkus-runner
    0000000000e7f000    7812    6144       0 r---- helloworld-quarkus-runner
    0000000001620000    2024    1448     308 rw--- helloworld-quarkus-runner
    000000000181a000       4       4       4 r---- helloworld-quarkus-runner
    000000000181b000      16      16      12 rw--- helloworld-quarkus-runner
    0000000001e10000    1740     156     156 rw---   [ anon ]
    [...]
    ffffffffff600000       4       0       0 r-x--   [ anon ]
    ---------------- ------- ------- -------
    total kB         1456800   20592    2684
    

    Evaluating the RSS values, it looks like native executable memory consumption is around 20MB.

    Memory consumption comparison

    In summary, the memory consumption data retrieved are:

    • JBoss EAP: 650MB
    • Packaged JAR: 130MB
    • Native builder: 20MB

    So, it's clear that there are advantages in terms of memory usage thanks to running the native executable.

    Conclusion

    In these articles, we explored how to modernize a Java application using technologies (CDI and Servlet 3) supported in Quarkus and provided an overview of different ways to develop, build, and run an application. We also showed how to capture memory consumption data in order to evaluate the improvements achieved during the modernization process.  These concepts provide the fundamentals for understanding how Quarkus works and why it's so useful, no matter whether the app is a simple helloworld quickstart or a more complex and production-level application.

    Last updated: July 1, 2020

    Recent Posts

    • Storage considerations for OpenShift Virtualization

    • Upgrade from OpenShift Service Mesh 2.6 to 3.0 with Kiali

    • EE Builder with Ansible Automation Platform on OpenShift

    • How to debug confidential containers securely

    • Announcing self-service access to Red Hat Enterprise Linux for Business Developers

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue