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

JFR: When starting a JVM with -XX:StartFlightRecording, output is written to stdout

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 11.0.7
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      jfr
    • Resolved In Build:
      b19
    • CPU:
      x86
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Applies to all operating systems.

      A DESCRIPTION OF THE PROBLEM :
      When a JVM is started with the -XX:StartFlightRecorder option, output is written to stdout indicating either success or failure that the recording is started. This breaks scripts that use Java in an interactive way to parse data, since the output message is in a non-structured form and does not match the format expected.

      For example, if a Java command is being used to base64 encode an input file, and write encoded output to stdout, then it cannot be profiled with JFR in situ since the output will then no longer be correct base64 encoded output. As the goal of JFR is to allow a low-latency profiling solution that can be enabled in production, any such command whose stdout is important cannot be used in this way.

      Providing a workaround option in the JFR.start DCmdStart to ignore output or have it routed elsewhere would be a way of disabling it, but a longer term option might be to use unified logging to display the message instead of stdout.


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              egahlin Erik Gahlin
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: