Spring Boot performance


Lately, we've been running out of memory in our AWS using several Microservices with SpringBoot. Therefore I decided to have a better look into the performance of one of our MS. There are several approaches for this, and cool tools around there. Here I'm attaching the very basic one, so you can have a look into your MS performance. I'm using Java Mission Control. Quite simple, already installed if you are using the JDK to develop.

How to use it
  • In the Terminal, type:
  • Open a new Terminal tab, and run your Microservice using the parameteres -XX:+UnlockCommercialFeatures -XX:+FlightRecorder
java -jar -XX:+UnlockCommercialFeatures -XX:+FlightRecorder YOURMICROSERVICES-1.0-SNAPSHOT.jar  
  • Open Oracle Mission Control, the project will be added. RightClick on it and select StartJMX Console.

Oracle JMX Console

There you can play around and see how the microservice is responding, using the Java Max and Min params:

-Xms<memory> -Xmx<memory>. 

Use M or G after the numbers for indicating Megs and Gigs of bytes respectively. -Xms indicates the minimum and -Xmx the maximum.

Below is the video from Oracle: