Re: RFD: Throttling Support for Java-Level JFR Events

Denghui Dong denghui.ddh at alibaba-inc.com
Thu Nov 16 16:41:37 UTC 2023


Hi Eric,
Thanks for the response.
> The JFR API allows users to create their own throttling mechanism using the SettingControl class.
Yes. However, not every user likes to implement a throttling mechanism by themselves.
> We are aware of that exception and I/O events could potentially benefit from throttling, but not sure the mechanism should work similar to native events.
The specific implementation method can be discussed further, if this feature is indeed necessary to be implemented at the JDK layer.
In addition to exception and I/O events as you mentioned, we also found the following situations that may benefit from this feature:
- Direct memory allocation by Unsafe API. There are quite a few applications or third-party libraries that use Unsafe API directly to allocate non-heap memory.
 The size of this portion of memory is out of the control of MaxDirectMemorySize and may cause memory leaks. Hence, using a JFR event to trace this API can
help the analysis, and throttling is obviously necessary. (Of course, such an event can be put at the JDK layer or native layer)
- The instance creation of some specific types. Current supported JFR events cannot specify the interested classes directly for Object allocation events.
Users may choose to create custom events, and throttling is needed here.
- Collecting RPC information which is similar to I/O events.
Thanks,
Denghui
------------------------------------------------------------------
From:Erik Gahlin <erik.gahlin at oracle.com>
Send Time:2023年11月16日(星期四) 05:01
To:hotspot-jfr-dev <hotspot-jfr-dev at openjdk.java.net>; 董登辉(卓昂) <denghui.ddh at alibaba-inc.com>
Subject:Re: RFD: Throttling Support for Java-Level JFR Events
Hi Denghui,
It's been considered it, but we like to see a few real use cases before adding it.
Do you see a use case for JDK events or for user defined events?
If user defined, could you describe the events?
The JFR API allows users to create their own throttling mechanism using the SettingControl class.
We are aware of that exception and I/O events could potentially benefit from throttling, but not sure the mechanism should work similar to native events. There is also visualization aspects to take into consideration. JMC would need to be updated so it can differentiate between outliers or throttling.
Thanks,
Erik
From: hotspot-jfr-dev <hotspot-jfr-dev-retn at openjdk.org> on behalf of Denghui Dong <denghui.ddh at alibaba-inc.com>
Sent: Wednesday, November 15, 2023 9:20 AM
To: hotspot-jfr-dev <hotspot-jfr-dev at openjdk.java.net>
Subject: RFD: Throttling Support for Java-Level JFR Events
Hi team,
We have observed increased adoption of JFR for information collection within our internal applications and frameworks.
However, we've encountered situations where critical events occur frequently, prompting us to explore
the possibility of introducing a throttling mechanism for Java-level events.
Currently, my understanding is that throttling is exclusively supported for native event ObjectAllocationSample.
Should we consider extending this feature to Java-level events?
 Thanks,
 Denghui Dong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-jfr-dev/attachments/20231117/d94803ce/attachment.htm>


More information about the hotspot-jfr-dev mailing list