Profile Image

What is JFR tuning: -XX:-FlightRecorderOptions?

What is JFR tuning: -XX:-FlightRecorderOptions? Have you used this JVM argument before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvm-argument

  • xx-flightrecorderoptions

  • x-flightrecorderoptions

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky



You can configure JFR with:


-XX:FlightRecorderOptions=parameter=value, where param is one of either:

  • allow_threadbuffers_to_disk={true|false} - Specifies whether thread buffers are written directly to disk if the buffer thread is blocked. By default, this parameter is disabled.
  • globalbuffersize=size - Specifies the total amount of primary memory used for data retention. The default value is based on the value specified for memorysize. Change the memorysize parameter to alter the size of global buffers.
  • maxchunksize=size - Specifies the maximum size (in bytes) of the data chunks in a recording. Append m or M to specify the size in megabytes (MB), and g or G to specify the size in gigabytes (GB). By default, the maximum size of data chunks is set to 12 MB. The minimum allowed is 1 MB.
  • memorysize=size - Determines how much buffer memory should be used, and sets the globalbuffersize and numglobalbuffers parameters based on the size specified. Append m or M to specify the size in megabytes (MB), and g or G to specify the size in gigabytes (GB). By default, the memory size is set to 10 MB.
  • numglobalbuffers - Specifies the number of global buffers used. The default value is based on the memory size specified. Change the memorysize parameter to alter the number of global buffers.
  • old-object-queue-size=number-of-objects - Maximum number of old objects to track. By default, the number of objects is set to 256.
  • repository=path - Specifies the repository (a directory) for temporary disk storage. By default, the system's temporary directory is used.
  • retransform={true|false} - Specifies whether event classes should be retransformed using JVMTI. If false, instrumentation is added when event classes are loaded. By default, this parameter is enabled.
  • samplethreads={true|false} - Specifies whether thread sampling is enabled. Thread sampling occurs only if the sampling event is enabled along with this parameter. By default, this parameter is enabled.
  • stackdepth=depth - Stack depth for stack traces. By default, the depth is set to 64 method calls. The maximum is 2048. Values greater than 64 could create significant overhead and reduce performance.
  • threadbuffersize=size - Specifies the per-thread local buffer size (in bytes). By default, the local buffer size is set to 8 kilobytes. Overriding this parameter could reduce performance and is not recommended.



Java Flight Recorder (JFR) is a tool for collecting diagnostic and profiling data about a running Java application. It is integrated into the Java Virtual Machine (JVM) and causes almost no performance overhead, so it can be used even in heavily loaded production environments. When default settings are used, both internal testing and customer feedback indicate that performance impact is less than one percent. For some applications, it can be significantly lower. However, for short-running applications (which are not the kind of applications running in production environments), relative startup and warmup times can be larger, which might impact the performance by more than one percent. JFR collects data about the JVM as well as the Java application running on it. -XX:FlightRecorderOptions allows you to modify JFR parameters. You can specify more than one parameter by separating them with comma.


Default Value:


Disabled by default






Related Posts:

  • About Java Flight Recorder


If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvm-argument

  • xx-flightrecorderoptions

  • x-flightrecorderoptions