tag:blogger.com,1999:blog-5171098727364395242.post1001999695783500079..comments2023-05-14T13:23:31.669+01:00Comments on Psychosomatic, Lobotomy, Saw: Where is my safepoint?Nitsanhttp://www.blogger.com/profile/10496299147100350513noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5171098727364395242.post-1144037758988711922015-04-29T18:56:35.538+01:002015-04-29T18:56:35.538+01:00Shorter, yes. Faster is an interesting question. W...Shorter, yes. Faster is an interesting question. We need to consider 2 cases:<br />1. Safe point is not triggered:<br />This is the common case, and for this case Zing has an extra instruction overhead. But we should consider that safepoint polls are not that frequent (while loop edge or method call exit), so in normal circumstances the cost difference is going to be very insignificant. This is a branch, but a highly predictable one, so we can expect the CPU to predict it correctly and get on with life. I can say (as the Lead Performance Eng. for Azul) that we have never had safepoint polls overhead come up as an issue either externally or internally.<br />2. Safe point is triggered:<br />For Zing we hit the unpredicted side of the branch, which has a cost, and then get on with the safepoint in user code. For OpenJDK we hit a page protection fault, which is raised in the kernel, the fault is then reported to the JVM which handles the safepoint. The overhead for OpenJDK in this case is much much higher. Is it likely to dominate the application pause time? I wouldn't think it's that bad, after all the JVM hits many safepoints that are hardly noticeable to most applications.<br />To summarize, it's an implementation choice, and both implementations are fine. I see the Zing implementation as consistent with the general goal of Zing to deliver consistently low pause times, but it's not the most important part in that general effort.Nitsanhttps://www.blogger.com/profile/10496299147100350513noreply@blogger.comtag:blogger.com,1999:blog-5171098727364395242.post-89213469391987846002015-04-29T17:34:14.192+01:002015-04-29T17:34:14.192+01:00Good explanation! But why is Zing using the cmp &a...Good explanation! But why is Zing using the cmp & jnz-pair then? Afaict, the OpenJDK:s safepoint instruction is both faster and shorter.Anonymoushttps://www.blogger.com/profile/15645689421894211861noreply@blogger.comtag:blogger.com,1999:blog-5171098727364395242.post-856486089691261932014-03-27T07:35:08.124+00:002014-03-27T07:35:08.124+00:00Thanks :)
True, true, I wanted to highlight the TT...Thanks :)<br />True, true, I wanted to highlight the TTSP will escape your notice if all you look at is GC logs, but you are correct that people should indeed look at the wider picture provided by "-XX:+PrintGCApplicationStoppedTime". I'm not sure this option gets the press it should (though Alexey does mention it in the referenced article)...Nitsanhttps://www.blogger.com/profile/10496299147100350513noreply@blogger.comtag:blogger.com,1999:blog-5171098727364395242.post-8063073120251458172014-03-26T22:59:41.284+00:002014-03-26T22:59:41.284+00:00Another great blog post Nitsan.
It's worth me...Another great blog post Nitsan.<br /><br />It's worth mentioning that if you use "-XX:+PrintGCApplicationStoppedTime" you can get pause times including the TTSP in your GC Logs. Its not just GC pause times though it includes all hotspot pauses, for example bulk lock inflation/deflation. On the other hand if you care about pauses you probably don't care about just GC pauses.Anonymoushttps://www.blogger.com/profile/15613912461272350420noreply@blogger.com