On Mon, 27 Apr 2026 16:01:10 GMT, Robert Toyonaga <[email protected]> wrote:

> This PR guards usage of FileForce, SocketRead, and SocketWrite events with 
> `jfrTracing` to prevent those classes from being loaded when JFR is not in 
> use. This is the same technique as what's currently used with exception 
> events and FileRead/FileWrite events.
> 
> I used NMT and a simple test app that exercises file force and socket IO 
> paths to check for a difference in memory usage.
> **NMT Before:** 
> Classes=1188, Metadata used=966064 B, Class space used=93008 B
> **NMT After:**
> Classes=1182, Metadata used=943728 B, Class space used=89456 B
> Note that the difference in amount used doesn't actually change amount 
> committed because the backing memory is pre-allocated in chunks with larger 
> granularity.
> 
> Testing:
> - new test test/jdk/jdk/jfr/event/io/TestEventsNotLoadedWithoutJfr.java to 
> check the guards work properly
> - tier 1
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: edc9c7f0
Author:    Robert Toyonaga <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/edc9c7f08cae100ac2521292b05de7e3713c5bf2
Stats:     282 lines in 10 files changed: 221 ins; 28 del; 33 mod

8331996: JFR: Add boolean check before loading event classes

Reviewed-by: alanb, stuefe

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

PR: https://git.openjdk.org/jdk/pull/30948

Reply via email to