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

JFR: Avoid parsing metadata.xml during startup

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      jfr
    • Resolved In Build:
      b03

      Description

      Descriptions about JVM events (fields, labels, data types etc.) are located in the file src/hotspot/share/jfr/metadata/metadata.xml. It is then parsed by the jdk.jfr module when JFR is initialized. The file is also processed by a generator that produces header files containing the C++ code for the native events.

      Instead of copying the metadata,xml file to the jdk.jfr module during packaging and parse the XML at every startup, it would be possible to read in the information in a binary format much quicker.

      One idea is to store the information in the class data archive used by the JVM, Storing the jdk.jfr classes (EventType, ValueDescriptor and AnnotationElement) could be problematic, since they contain references to class IDs that depends on which order classes are loaded in the JVM. It might be sufficient to load the intermediate representation (TypeElement, FieldElement) which corresponds to the XML-element and then process it like we do today.

      Another idea is to let the program that generates the native JFR files also generate a binary file. After all, the generator program has all in the information in memory already so it only needs to write it into a DataOutputStream, which could quickly be read using a DataInputStream.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              egahlin Erik Gahlin
              Reporter:
              egahlin Erik Gahlin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: