Nov 8, 2018

How to enable Java Flight Recorder (JFR) for Glassfish

First, make sure your Glassfish is using JDK7u40+, check your system's java version. Or use AS_JAVA to control which version of Java GlassFish should use in the  glassfish/config/asenv.conf file.

Add to JVM from admin panel or to domain.xml file the following option:

For v4:


<jvm-options>-XX:+UnlockCommercialFeatures</jvm-options>
<jvm-options>-XX:+FlightRecorder</jvm-options>


For v3:


<java-config ... debug-enabled="true" debug-options="... -XX:+UnlockCommercialFeatures -XX:+FlightRecorder">