<html><head></head><body><div class="ydpe30b431byahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
<div dir="ltr" data-setdir="false">Hi,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">As commented here Allocation Stalls is a MUST to proper monitor ZGC performance, because in practice is usually the main contributor to latency spikes.<br><br>In our case we are monitoring JVM memory and Gen ZGC collections via MBeans, and I would say that is still quite common (e.g. Spring actuator).</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">JFR events will provide the info, BUT at least has small performance penalty compared with MBeans. In my view having the info via JMX could be a nice addition. Probably having something like number of allocation stalls and the accumulated time for all of them could be a great addition in my view.<br><br>Thanks a lot for all the good work with ZGC.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Regards,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Evaristo</div><div><br></div>
</div><div id="yahoo_quoted_5918763373" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
En martes, 22 de abril de 2025, 08:59:42 CEST, Stefan Karlsson <stefan.karlsson@oracle.com> escribió:
</div>
<div><br></div>
<div><br></div>
<div><div id="yiv1653332920"><div>
Hi Misha,<br clear="none">
<br clear="none">
<div class="yiv1653332920moz-cite-prefix">On 2025-04-21 23:49, Misha Dmitriev
wrote:<br clear="none">
</div>
<blockquote type="cite">
<style type="text/css">#yiv1653332920 P {margin-top:0;margin-bottom:0;}</style>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
Hi ZGC team,</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
<br clear="none">
</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
Are there any plans at this time to enable emission of Thread
Stall events through MXBeans? We all know that ZGC
stop-the-world GC pauses are normally very short. But we've
noticed that for real apps at LinkedIn, thread stalls can
sometimes be really long (up to a few sec), and apparently, they
may affect latencies very noticeably at times. Thus, any system
that monitors ZGC performance needs to track both types of GC
events. We currently achieve that in some of our monitoring
systems through gc.log parsing in real time, but MXBeans may
have some advantages in some situations.</div>
</blockquote>
<br clear="none">
Just to be sure we are on the same page, when you are saying Thread
Stall events are you referring to what we call Allocation Stalls,
where Java threads are waiting for the GC to reclaim memory? Or are
referring to all kinds of stall that could block the threads?<br clear="none">
<br clear="none">
We don't have any plans to add more MXBeans to ZGC, but maybe we
should? Nowadays we tend to send events through JFR instead, and I
don't see much new development of features with MXBeans in the JVM.
I'll bring question up with the Serviceability team.<br clear="none">
<br clear="none">
If JFR would work for you, we do have the ZAllocationStall event
that gets sent every time we hit an allocation stall. Maybe this
together with the newish JFR streaming API would be enough to
monitor these stalls? See: <a rel="nofollow noopener noreferrer" shape="rect" target="_blank" href="https://openjdk.org/jeps/349" class="yiv1653332920moz-txt-link-freetext">https://openjdk.org/jeps/349</a><br clear="none">
<br clear="none">
Cheers,<br clear="none">
StefanK<div id="yiv1653332920yqtfd11802" class="yiv1653332920yqt5759529750"><br clear="none">
<br clear="none">
<blockquote type="cite">
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
<br clear="none">
</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
The same question is valid for Shenandoah as well.</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
<br clear="none">
</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
Thanks,</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
<br clear="none">
</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
Misha<br clear="none">
</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
<br clear="none">
</div>
<div style="font-family:Aptos, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);" class="yiv1653332920elementToProof">
</div>
</blockquote>
<br clear="none">
</div></div></div></div>
</div>
</div></body></html>