New throttle setting

Erik Gahlin erik.gahlin at oracle.com
Wed May 21 16:05:46 UTC 2025


Hello,

I'm planning to add rate-limited sampling to Java events. It will work similarly to the JVM event jdk.ObjectAllocationSample today. Hopefully, it will make it into JDK 25. I mention this because it may have an impact on JMC. The following events will get a new setting called "throttle", where a rate can be specified.

 - jdk.SocketRead
 - jdk.SocketWrite
 - jdk.FileRead
 - jdk.FileWrite
 - jdk.JavaExceptionThrow

The filtering will happen after the threshold setting has been applied. The purpose of the new setting is to have more events enabled by default. The threshold for I/O events today is 20 ms, which is rather high to avoid high CPU usage and buffers being flooded in pathological applications.

It may be possible to set the threshold to 0 ms for I/O events when rate-limited sampling is in use in the default configuration, but I'm worried about regressions, so the current plan is to set the threshold to 1 ms and throttle to 300/s. For the profile configuration, the threshold will be set to 0 ms and the rate increased to 600/s.

The jdk.JavaErrorThrow event will continue to work as before.

Long-term, the plan is to sample exceptions per allocation site and remove jdk.JavaErrorThrow. The implementation is more complicated, but  I think this will be an improvement for now.

For JDK 25, the plan is to add control options for method timing and tracing, as part of JEP 520: JFR Method Timing & Tracing. I noticed that the new options will fill the recording wizard, so not all options are visible. The dialog is too small. If we get throttling for I/O and exceptions into JDK 25, the exception combobox and I/O threshold text box can be removed, so it will be fine without any code changes to JMC.

If you have questions, please let me know, either here or on the JMC Slack channel.

Thanks,
Erik

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jmc-dev/attachments/20250521/c1def745/attachment.htm>


More information about the jmc-dev mailing list