Profile your java application with VisualVM
From time to time the need arises to profile an application. Up until JDK 8, Oracle bundled VisualVM into the JDK and thus it was available by default. By now I always use the JDKs provided by Azul, and thus don’t have VisualVM available anymore.
To still use it, go to their website and download the latest release. To follow the steps in this post, chose the zip file option.
Once extracted, from the command line, change directory to visualvm_204/bin
.
Be aware that the current version of VisualVM might not always support the latest version of the JDK.
I’m running VisualVM for example here with JDK 14, although JDK 15 is the latest release.
./visualvm --jdkhome "/Library/Java/JavaVirtualMachines/zulu-14.jdk/Contents/Home"