Any plans to emit Thread Stall events through MXBeans?

Stefan Karlsson stefan.karlsson at oracle.com
Tue Apr 22 06:59:03 UTC 2025


Hi Misha,

On 2025-04-21 23:49, Misha Dmitriev wrote:
> Hi ZGC team,
>
> 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.

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?

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.

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: https://openjdk.org/jeps/349

Cheers,
StefanK

>
> The same question is valid for Shenandoah as well.
>
> Thanks,
>
> Misha
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/zgc-dev/attachments/20250422/186d1522/attachment-0001.htm>


More information about the zgc-dev mailing list