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

JFR: Remove event handlers

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 19
    • None
    • hotspot
    • None
    • jfr
    • b22

      Move instrumentation code from event handler into the commit() method.

      Pros:
      - Reduced startup time (allow more Java events)
      - Avoid memory leak
      - Easier to generate byte code at build time.
      - Simplify implementation of the Event metrics features.
      - Less code to maintain

      This was the initial implementation for JDK 9, but handlers were added to prevent the buffer writer to be accessible from other context than the commit() method, which would allow arbitrary data to be written into native buffers.

      We were aware of the memory leak back then, but could not come up with a better solution. Startup cost has become more important with increased number of events in the JDK and other features that impacts byte code generation.

      We need to revisit this.

            egahlin Erik Gahlin
            egahlin Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: