Java Profiling
VisualVM
- Download VisualVM (doesn’t need to be installed) and run it.
- Run the java application
- In VisualVM, you should see started application under “Local” and you can already monitor CPU and memory usage.
- Go to “Profiler” tab and click on “Profile: CPU”
- If it doesn’t work, you might need to add
-Xverify:noneas JVM argument and restart your application - You should see opened threads and method calls according to you
Profile classesfilter. - If you want to profile springframework classes, add
org.springframework.**toProfile classesfilter.
Profiling with IntelliJ
This is a IntelliJ Ultimate feature. Don’t even try it with community edition.