As a warning, if you use JFR in the Oracle Java SDK, you have to pay a commercial license. If you want to avoid the legion of Oracle lawyers, only use JFR in OpenJDK.
https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-g... https://www.oracle.com/java/technologies/javase-subscription...