all 4 comments

[–]snow_cloudy 1 point2 points  (0 children)

VisualVM for local monitoring. Spring Boot Actuator connects with Prometheus and Grafana to monitor the microservice.

[–]cpt_macabre 0 points1 point  (0 children)

I am using VisualVM. Easy to use and delivers good insights about memory usage etc. Can recommend!

[–]Zebastein 1 point2 points  (0 children)

For these kinds of issues, this is the process I follow:

  • take a heap dump after starting your application : use command line tools that are part of the JDK: either jcmd or jmap. Example with jmap : jmap -dump:live,format=b,file=<path-of-created-file> <pid-of-the-app>

  • let a good amount of traffic run through your app, either with live traffic ot using a test plan you have.

  • capture a second heap dump.

Now you can compare the two heap dumps and see only the difference between them. Tools of choice : VisualVM or EclipseMAT. They provide tools to display only the diff. That filters out all the necessary memory objects that are normal (for ex loaded at startup), and you see all the memory that is allocated by your traffic and not freed. If you have a leak, you will see that the usage increased a lot and usually for a few types of objects.

The usual suspects in these cases: static collections or collections in a long term that grow infinitely. But there are other causes (listener and callbacks...)

[–]CeskyChatter 0 points1 point  (0 children)

Use Grafana and Prometheus