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

JFR: Avoid parsing metadata.xml during startup



    • Enhancement
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 15
    • 16
    • hotspot
    • None
    • jfr
    • b03


      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.


        Issue Links



              egahlin Erik Gahlin
              egahlin Erik Gahlin
              0 Vote for this issue
              3 Start watching this issue