Profiling Spring Boot Applications with VisualVM
Profiling Spring Boot Applications with VisualVM

Profiling Spring Boot Applications with VisualVM

Author
Shiv Bade
Tags
spring boot
profiling
visualvm
Published
January 30, 2015
Featured
Slug
Tweet
I was debugging a high CPU usage issue in one of our Spring Boot services. Turned out to be an accidental infinite loop triggered by malformed input.
To catch it, I used VisualVM: 1. Start your Spring Boot app with remote debug flags:
java -Dcom.sun.management.jmxremote -jar myservice.jar
  1. Connect via VisualVM and inspect CPU sampling
  1. Sort by method usage, identify hotspots
Console output:
Method | Time | Invocations loopProcessor() | 97.2% | 2,193,840
Lesson: Always watch for unbounded iterations, especially when processing user input.