RFR: 8370242: JFR: Clear event reference eagerly when using EventStream

Markus Grönlund mgronlun at openjdk.org
Tue Oct 21 16:28:59 UTC 2025


On Mon, 20 Oct 2025 20:50:41 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

> Could I have review of a change that reduce the live set when using event streaming?
> 
> The EventDirectoryStream and EventFileStream classes may hold on to events longer than needed. If a burst of events occurs, the sorted cache is filled, but if fewer events are emitted later, old events still remain in the cache array. They should be cleared after they have been dispatched.
> 
> This is effectively a memory leak, although it does not grow over time.
> 
> Testing: jdk/jdk/jfr
> 
> Thanks
> Erik

Looks good.

-------------

Marked as reviewed by mgronlun (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27906#pullrequestreview-3361647146


More information about the hotspot-jfr-dev mailing list