<div class="__aliyun_email_body_block"><div  style="line-height:1.7;font-family:Microsoft Yahei;font-size:14.0px;color:#000000;"><div  style="clear:both;"><span >Hi Eric,</span><div  style="clear:both;"><br ></div><div  style="clear:both;">Thanks for the response.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">> The JFR API allows users to create their own throttling mechanism using the SettingControl class.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">Yes. However, not every user likes to implement a throttling mechanism by themselves.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">> 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.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">The specific implementation method can be discussed further, if this feature is indeed necessary to be implemented at the JDK layer.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">In addition to exception and I/O events as you mentioned, we also found the following situations that may benefit from this feature:</div><div  style="clear:both;">- 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.</div><div  style="clear:both;"> 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</div><div  style="clear:both;">help the analysis, and throttling is obviously necessary. (Of course, such an event can be put at the JDK layer or native layer)</div><div  style="clear:both;"><br ></div><div  style="clear:both;">- The instance creation of some specific types. Current supported JFR events cannot specify the interested classes directly for Object allocation events.</div><div  style="clear:both;">Users may choose to create custom events, and throttling is needed here.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">- Collecting RPC information which is similar to I/O events.</div><div  style="clear:both;"><br ></div><div  style="clear:both;">Thanks,</div><span >Denghui</span></div><div  style="clear:both;"><br ></div><blockquote  style="margin-right:.0px;margin-top:.0px;margin-bottom:.0px;font-family:Tahoma,Arial,STHeiti,SimSun;font-size:14.0px;color:#000000;"><div  style="clear:both;">------------------------------------------------------------------</div><div  style="clear:both;">From:Erik Gahlin <erik.gahlin@oracle.com></div><div  style="clear:both;">Send Time:2023年11月16日(星期四) 05:01</div><div  style="clear:both;">To:hotspot-jfr-dev <hotspot-jfr-dev@openjdk.java.net>; 董登辉(卓昂) <denghui.ddh@alibaba-inc.com></div><div  style="clear:both;">Subject:Re: RFD: Throttling Support for Java-Level JFR Events</div><div  style="clear:both;"><br ></div><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">Hi </span><span  class=" __aliyun_node_has_color __aliyun_node_has_bgcolor" style="letter-spacing:normal;font-family:'Microsoft Yahei';font-size:14.0px;font-weight:400;color:#000000;background-color:#ffffff;">Denghui</span><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">,</span><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;"><br ></span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">It's been considered it, but we like to see a few real use cases before
 adding it.</span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;"><br ></span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">Do you see a use case for JDK events or for user defined events?</span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;"><br ></span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">If user defined, could you describe the events?</span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;"><br ></span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">The JFR API allows users to create their own throttling mechanism using
 the SettingControl class.</span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;"><br ></span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">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.</span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;"><br ></span></div><div  class=" __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">Thanks,</span></div><div  class="elementToProof __aliyun_node_has_bgcolor" style="text-align:left;margin:.0px;background-color:#ffffff;"><span  class=" __aliyun_node_has_color" style="letter-spacing:normal;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;font-weight:400;color:#000000;">Erik</span></div><div  class="elementToProof __aliyun_node_has_color" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:16.0px;color:#000000;"><br ></div><div  id="appendonsend"></div><hr  style="display:inline-block;width:98.0%;"><div  id="divRplyFwdMsg"><span  style="font-size:15.0px;color:#000000;font-family:Calibri,sans-serif;"><b >From:</b> hotspot-jfr-dev <hotspot-jfr-dev-retn@openjdk.org> on behalf of Denghui Dong <denghui.ddh@alibaba-inc.com><br ><b >Sent:</b> Wednesday, November 15, 2023 9:20 AM<br ><b >To:</b> hotspot-jfr-dev <hotspot-jfr-dev@openjdk.java.net><br ><b >Subject:</b> RFD: Throttling Support for Java-Level JFR Events</span><div > </div></div><div  class=" __aliyun_node_has_color" style="line-height:1.7;font-family:'Microsoft Yahei';font-size:14.0px;color:#000000;"><div  style="clear:both;">Hi team,<br ></div><div  style="clear:both;"><div  class=" __aliyun_node_has_color" style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:'Microsoft Yahei';font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:.0px;text-transform:none;word-spacing:.0px;white-space:normal;text-decoration-style:initial;text-decoration-color:initial;clear:both;"><br ></div><div  class=" __aliyun_node_has_color" style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:'Microsoft Yahei';font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:.0px;text-transform:none;word-spacing:.0px;white-space:normal;text-decoration-style:initial;text-decoration-color:initial;clear:both;"><span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;">We have observed increased adoption of JFR for information collection within our internal applications and frameworks.</span></div><div  class=" __aliyun_node_has_color" style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:'Microsoft Yahei';font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:.0px;text-transform:none;word-spacing:.0px;white-space:normal;text-decoration-style:initial;text-decoration-color:initial;clear:both;"><br ><div  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;clear:both;">However, we've encountered situations where critical events occur frequently, prompting us to explore</div><div  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;clear:both;">the possibility of introducing a throttling mechanism for Java-level events.</div><div  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;clear:both;"><br ></div><div  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;clear:both;">Currently, my understanding is that throttling is exclusively supported for native event ObjectAllocationSample.</div><span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;">Should we consider extending this feature to Java-level events?</span></div><div  class=" __aliyun_node_has_color" style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:'Microsoft Yahei';font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:.0px;text-transform:none;word-spacing:.0px;white-space:normal;text-decoration-style:initial;text-decoration-color:initial;clear:both;"><span  style="margin:.0px;padding:.0px;border:.0px;outline:.0px;"><br ></span></div><div  class=" __aliyun_node_has_color" style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:'Microsoft Yahei';font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:.0px;text-transform:none;word-spacing:.0px;white-space:normal;text-decoration-style:initial;text-decoration-color:initial;clear:both;">
Thanks,</div><div  class=" __aliyun_node_has_color" style="margin:.0px;padding:.0px;border:.0px;outline:.0px;color:#000000;font-family:'Microsoft Yahei';font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:.0px;text-transform:none;word-spacing:.0px;white-space:normal;text-decoration-style:initial;text-decoration-color:initial;clear:both;">
Denghui Dong</div></div></div></blockquote></div></div>