RFR: 8365611: Throttle any JFR event [v2]
Markus Grönlund
mgronlun at openjdk.org
Mon Aug 18 13:45:12 UTC 2025
On Mon, 18 Aug 2025 13:30:31 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> src/hotspot/share/jfr/recorder/service/jfrEventThrottler.cpp line 117:
>>
>>> 115:
>>> 116: JfrEventThrottler* JfrEventThrottler::create_throttler(JfrEventId id) {
>>> 117: JfrEventThrottler* p = new JfrEventThrottler(id);
>>
>> JfrEventThrottler is a JfrAdaptiveSampler that utilizes the JfrCHeapObj allocator, which can return nullptr during JFR initialization.
>
> Are you sure?
>
> ..
>
> Ah, I see it now. You end up calling the nothrow variant of `CHeapObjBase::operator new`. And treat malloc OOMs during initialization as non-fatal, runtime malloc OOMs as fatal.
>
> May I ask why you bother? Is the memory footprint of JFR really so high as to make this distinction worthwhile? (As in "if JVM does not come up with JFR, the footprint without JFR will be so much lower that it is worth trying"?)
Because JFR can be started dynamically during runtime, from the outside.
We don't want someone killing the JVM by starting JFR.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26801#discussion_r2282441434
More information about the hotspot-jfr-dev
mailing list