Java Profiling
Profilers
VisualVM
VisualVM is a good profiler for local profiling with a GUI.
However, it cannot collect CPU samples or timings on remote JVMs.
Eclipse Mission Control
Eclipse Mission Control is also a good profiler that can collect CPU samples on remote JVMs.
It's originally an Oracle software which has been adopted by the Adoptium project.
The profiler itself is named Java Flight Recorder, and produces .jfr files.
Flight Recorder can be started on a JVM process that is already running with the jcmd
tool.
.jfr files can then be read by Eclipse Mission Control and also VisualVM.
jvmtop
A Linux command-line program that acts like top
for JVM processes.
jvm-mon
A Linux command-line program with a little more visual interface compared to jvmtop.
JProfiler
JProfiler is the industry standard Java profiler, but it's expensive.
It can collect CPU samples and timings on a remote JVM.
IntelliJ Profiler
The IntelliJ profiler is wholly or partly behind the paywall IntelliJ Ultimate version.
It does not support remote profiling.
hprof
hprof is a tool that comes with the JVM. However, it seems to have many issues.
It's overhead-heavy, and has been accused of having serious problems.
It is not included with my version of the Adoptium Java 11 JVM, meaning they ditched the tool entirely.
JIP
JIP is hprof but with lower overhead, and implemented entirely in Java. And a few extra features.
It sounds good, but the main repository was last updated in 2014, and the documentation says it "requires Java 5".
honest-profiler
honest-profiler claims to solve the problem of stack-trace collection being restricted to safe points.
It does not work on Windows because it relies on a UNIX-derived technology.