Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278419

JFR jcmd option contract "This value cannot be changed once JFR has been initialized" is not enforced

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 18
    • 18
    • hotspot
    • None
    • jfr
    • b28
    • Verified

        Several options are exposed via the jcmd JFR.configure command, and their descriptions make it quite clear that "This value cannot be changed once JFR has been initialized".
        IIRC, it used to be the case that these values were prevented from being set after initialization, but somehow the proper enforcements are no longer in place.

        For example:

        The option "stackdepth=" is used to configure the default depth for capturing stacktraces. The option is available on the command-line, like -XX:FlightRecorderOptions:stackdepth=64.

        The option is also exposed via jcmd, via the JFR.configure command, for example:

        jcmd <pid> JFR.configure stackdepth=64

        The contract specified for the option when using jcmd JFR.configure during runtime is as follows:

        Option:
        stackdepth

        Description:
        (Optional) Stack depth for stack traces. Setting this value greater than the default of 64 may cause a performance degradation. This value cannot be changed once JFR has been initialized. (LONG, 64));

        Not enforcing this condition is problematic because the stacktrace buffers are allocated with the value specified on startup, but the stacktrace capture code will use the current depth value.

              mgronlun Markus Grönlund
              mgronlun Markus Grönlund
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: