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.
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.
- relates to
-
JDK-8340364 Shenandoah: Dead class mirrors crash GC
- Open
-
JDK-8286647 JFR: Build failure when C1 or C2 is disabled after JDK-8282420
- Resolved
-
JDK-8250913 EventHandlerCreator embeds an unnecessary StringPool
- Closed
-
JDK-8297911 Memory leak in JfrUpcalls::on_retransform
- Resolved
(1 links to)