{"id":1230,"date":"2020-07-14T19:43:58","date_gmt":"2020-07-14T18:43:58","guid":{"rendered":"http:\/\/hirt.se\/blog\/?p=1230"},"modified":"2020-07-14T19:52:39","modified_gmt":"2020-07-14T18:52:39","slug":"the-best-of-java-tournament","status":"publish","type":"post","link":"https:\/\/hirt.se\/blog\/?p=1230","title":{"rendered":"The &ldquo;Best of the JDK&rdquo; Tournament"},"content":{"rendered":"<p>Over the last few weeks, there has been a <a href=\"https:\/\/twitter.com\/java\/status\/1265311257323683841?s=20\">knock-out tournament<\/a> raging on Twitter, where various Java technologies have battled out which JDK technology is the best. It\u2019s all part of the activities taking place around the celebration of Java turning 25 years. And boy, have those years been interesting.<\/p>\n<p>Like many languages in use today, Java started out with a simple interpreter. That is, by the way, how Java got a reputation for being slow. Today, Java peak performance can surpass that of statically compiled languages, owing to optimizations only possible when runtime information is available. But I <a href=\"https:\/\/www.amazon.com\/Oracle-JRockit-Definitive-Marcus-Hirt\/dp\/1847198066\">digress<\/a>&#8230;<\/p>\n<p>As many of you know, I started out co-founding a company named Appeal &#8211; the company that created the JRockit JVM. We did quite a few cool things during that time; some of them relevant to the knock-out competition. We built the world\u2019s first JVM management console, mostly since the application to become a Java licensee (so that JRockit could become a Sun certified JVM) required us to state a value-add. Our original application stated \u201cbetter performance\u201d, and was summarily turned down. \ud83d\ude09 With the work on the management console we eventually consolidated an API to monitor and manage the JVM &#8211; JMAPI (the JRockit Management API), which later inspired &#8211; and was superseded by &#8211; JSR-174 (java.lang.management)[1].<\/p>\n<p>We also built a tool we called JRA (JRockit Runtime Analyzer). It really started out as a tool for finding out how the JVM was performing at customer installations &#8211; we needed information to better understand how to improve the JVM for real world usage. Customers, quite understandably, refused to let us borrow their applications to run them in our labs. To make it easy for them to understand and verify the data they were sharing, it was all emitted as text (XML). It didn\u2019t take long for customers to see us use the tool and the (accidental) value it brought for optimizing their applications &#8211; was the tool perhaps for sale? As a startup, we of course said yes, and made it into a product. When we later introduced the JRockit DetGC (deterministic GC), there was a need to be able to prove that the GC was keeping the latency contract, and show where in the customer code any thread halts were caused (e.g. due to bad synchronization). So the JRockit Runtime Analyzer was extended with LAT (the Latency Analysis Tool), which now introduced a binary artifact for the latency data for better data density and less serialization cost. In the end the JRA and LAT was unified into a single model &#8211; JFR (JRockit Flight Recorder, later Java Flight Recorder, and finally re-dubbed into JDK Flight Recorder when it was open sourced). We also created an impossibly cool on-line <a href=\"https:\/\/subscription.packtpub.com\/book\/application_development\/9781847198068\/10\/ch10lvl1sec69\/the-general-purpose-heap-analyzer\">memory analysis tool<\/a> (which was sadly never ported to hotspot), together with a slew of other little tools and utilities.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"393\" title=\"Memleak Tool\" style=\"margin-right: auto;margin-left: auto;float: none\" alt=\"The good old JMC memleak tool\" src=\"https:\/\/lh3.googleusercontent.com\/0eeZRmGe37NQAoYmgoR-vnEXdNwUMuKW47IStb7U0wqqQrvx9meoS5A-gGTUTh35PxlwMYAoNC1pWnKb3mfSxueSUq-b6kaInUVr-Z0I3rNW8aiL_aBV-1-6dIPXv0MFTJcnODZC\"><\/p>\n<p>Some of these tools converged into Java Mission Control, which became the hub for the cool tools we were developing.<\/p>\n<p><a href=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2020\/07\/mc_512x512.png\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"240\" title=\"JMC Logo\" style=\"border: 0px currentcolor;margin-right: auto;margin-left: auto;float: none;background-image: none\" alt=\"JMC Logo\" src=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2020\/07\/mc_512x512_thumb.png\" border=\"0\"><\/a><\/p>\n<p>I was happily surprised to see JDK Mission Control included in the \u201cBest of the JDK\u201d feature face off. I was doing little dad-dances (to the embarrassment of my kids) in total astonishment when JDK Mission Control got up against the runtime and language features and ultimately won the whole thing.<\/p>\n<p><b><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"379\" title=\"Competition Results\" style=\"margin-right: auto;margin-left: auto;float: none\" alt=\"Competition Results\" src=\"https:\/\/lh3.googleusercontent.com\/7eel8-FiF2T_TIUBo54PxF6wTfU9SCqBZvB4Q2cA4Qsj6G6t2TPjG_7M_zYZyvNcz7OoMVfKpU_ZSZvtO4_X74u76A6F1WUbSKbEZqU-jmXQKytmpWpb_1JsHGgF5qX7UVZDhAmM\"><\/b><\/p>\n<h2><\/h2>\n<h2>Tech Poetry Throw-Down<\/h2>\n<p><b><\/b><\/p>\n<p>One of the best parts of this whole competition was when <a href=\"https:\/\/twitter.com\/costlow\">Erik Costlow<\/a> wrote some poetry in support of JDK Mission Control. This sparked an epic tech-poetry throw-down with little poems in favour of various Java technologies.<\/p>\n<p>Here are a few of my favourites entries for JMC &amp; JFR (in no particular order):<\/p>\n<blockquote><p>Of JDK Mission Control<\/p>\n<p>whose benefits I will extol:<\/p>\n<p>It watches performance<\/p>\n<p>while still in conformance<\/p>\n<p>So therefore it should win this poll.<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/costlow\/status\/1278424340770566144?s=20\">@costlow<\/a><\/p><\/blockquote>\n<p>(The one which started the it all)<\/p>\n<blockquote><p>2 am in the morning, my mobile chimed,<\/p>\n<p>The war room conf call had to be primed.<\/p>\n<p>JVM\u2019s are down, the helpdesk said,<\/p>\n<p>Touch troubleshooting road ahead.<\/p>\n<p>CPU? GC? Bad Code?, the questions abound,<\/p>\n<p>The root cause was far from being found.<\/p>\n<p>Tumultuous voiced from Dev to Ops, each one declaring the were clean<\/p>\n<p>No path to the solution was to be seen.<\/p>\n<p>With a prayer, I fired up the Java Flight Recorder,<\/p>\n<p>Hoping this would restore some war room order.<\/p>\n<p>Lo! And behold, the histogram revealed<\/p>\n<p>\u2018Twas a code deadlock, the system could yet be healed!<\/p>\n<p>Helpful NullPointer messages, I hear you say,<\/p>\n<p>Who will alert you whilst you are away?<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/perfclarity\/status\/1278846778389876737?s=20\">@perfclarity<\/a><\/p><\/blockquote>\n<blockquote><p>To see or not to see (perf data)<\/p>\n<p>That is the question (mission control answers).<\/p>\n<p>Whether \u2018tis nobler in the code<\/p>\n<p>To suffer the zings and harrows of outrageous finger pointing<\/p>\n<p>Or to stream events and by analyzing, end it<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/costlow\/status\/1278520848849174529?s=20\">@costlow<\/a><\/p><\/blockquote>\n<blockquote><p>I have never<\/p>\n<p>had to deal<\/p>\n<p>with NullPointer<\/p>\n<p>Exceptions<\/p>\n<p>and which<\/p>\n<p>many people want<\/p>\n<p>to have<\/p>\n<p>better messages<\/p>\n<p>Forgive me<\/p>\n<p>but my vote goes to JMC<\/p>\n<p>it is so sweet<\/p>\n<p>and so cold<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/stuartmarks\/status\/1278540741422149636?s=20\">@stuartmarks<\/a><\/p><\/blockquote>\n<blockquote><p>To think that I could ever see<\/p>\n<p>A tool so lovely: JMC<\/p>\n<p>A tool that streams events all day<\/p>\n<p>Yet still performs without delay.<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/costlow\/status\/1281614229011943424?s=20\">@costlow<\/a><\/p><\/blockquote>\n<blockquote><p>If you need to control a mission<\/p>\n<p>OpenJDK had an omission<\/p>\n<p>And then JMC<\/p>\n<p>Was suddenly free<\/p>\n<p>Without even rights of rescission<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/stuartmarks\/status\/1278791742938963969?s=20\">@stuartmarks<\/a><\/p><\/blockquote>\n<blockquote><p>So much value inside JMC<\/p>\n<p>Yet usage was low, tis it wasn\u2019t free<\/p>\n<p>But low and behold<\/p>\n<p>Oracle open sourced it in whole<\/p>\n<p>And now productivity is as easy can be<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/Sharat_Chander\/status\/1278796499829194752?s=20\">@Sharat_Chander<\/a><\/p><\/blockquote>\n<blockquote><p>As I stream through the events of my workload perf pain<\/p>\n<p>I take a look post 8 life and realize this tool should reign<\/p>\n<p>\u2018cause that\u2019s just perfect for a coder like me<\/p>\n<p>You know we love fancy things like JDK MC<\/p>\n<p>Been spendin\u2019 most our lives livin\u2019 in a coder\u2019s paradise<\/p>\n<p>&#8211; <a href=\"https:\/\/twitter.com\/costlow\/status\/1278672144130596865?s=20\">@costlow<\/a><\/p><\/blockquote>\n<p>Here are a few of my favourites for the other technologies:<\/p>\n<blockquote><p>Null pointer exception<\/p>\n<p>Is a old familiar friend<\/p>\n<p>And she wants to be<\/p>\n<p>more helpful again<\/p>\n<p>With deep information<\/p>\n<p>I can only begin to extol<\/p>\n<p>Love for NPE<\/p>\n<p>For she should win<\/p>\n<p>this Java poll<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/manicode\/status\/1278472627732922368?s=20\">@manicode<\/a><\/p><\/blockquote>\n<blockquote><p>There was a NullPointerException<\/p>\n<p>Whose message needs amplification<\/p>\n<p>To the VM some hacks<\/p>\n<p>Add the relevant facts<\/p>\n<p>And no longer is it an obsession<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/stuartmarks\/status\/1278789533115379712?s=20\">@stuartmarks<\/a><\/p><\/blockquote>\n<blockquote><p>As I try to decipher my NPE in grails<\/p>\n<p>The Greater Sage-Grouse wanders the sage brush<\/p>\n<p>The grouse and I are one<\/p>\n<p>For I can\u2019t decipher less helpful NPE\u2019s in grails<\/p>\n<p>Any more than the sage-grouse knows why it wanders the sagebrush<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/manicode\/status\/1278528007519399936?s=20\">@manicode<\/a><\/p><\/blockquote>\n<blockquote><p>I&#8217;m on a boat motherf$%^r take a look at me<\/p>\n<p>Straight floatin&#8217; on a boat debugging NPE<\/p>\n<p>Busting five knots, wind whipping out my coat<\/p>\n<p>You can&#8217;t stop me motherf$%^r cause I&#8217;m debugging on a boat<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/manicode\/status\/1278770430161981440?s=20\">@manicode<\/a><\/p><\/blockquote>\n<blockquote><p>The usability of NullPointerExceptions<\/p>\n<p>have historically been an issue<\/p>\n<p>by adding static code to dynamic exceptions<\/p>\n<p>our problems we can diffuse<\/p>\n<p>Let go of your stack trace debugging hate<\/p>\n<p>And vote for JEP Three Fifty Eight!<\/p>\n<p>&nbsp; &#8211; <a href=\"https:\/\/twitter.com\/manicode\/status\/1278752112197767168?s=20\">@manicode<\/a><\/p><\/blockquote>\n<p>Many thanks to @costlow, @manicode, @stuartmarks, @perfclarity and @Sharat_Chander for all the laughs! \ud83d\ude42<\/p>\n<h2>Thanks!<\/h2>\n<p>Yes, I know this is a silly little Twitter competition. But, if nothing else, this silly little competition provides an excellent opportunity for me to give some overdue thanks:<\/p>\n<ul>\n<li>Plenty of thanks and love to all of the users of JMC out there, using JMC to solve tricky problems in production systems on a daily basis.<\/li>\n<li>Many thanks to everyone who voted for JMC. I didn\u2019t think a tool would stand a chance against language and runtime features.<\/li>\n<li>Huge thanks to all the developers on the JDK Mission Control team, and to all the developers on the JDK serviceability team. You\u2019re a really awesome bunch, and it\u2019s a privilege for me to be working with you.<\/li>\n<li>Major kudos to Oracle for open sourcing JDK Mission Control and JDK Flight Recorder.<\/li>\n<li>Many thanks to the main sponsors of the development of JDK Mission Control:<\/li>\n<ul>\n<li><a href=\"https:\/\/www.oracle.com\/index.html\">Oracle<\/a><\/li>\n<li><a href=\"https:\/\/www.redhat.com\/\">Red Hat<\/a><\/li>\n<li><a href=\"http:\/\/datadoghq.com\">Datadog<\/a><\/li>\n<\/ul>\n<\/ul>\n<p><b><a href=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2020\/07\/jrockit_duke_love.png\"><img loading=\"lazy\" decoding=\"async\" width=\"244\" height=\"209\" title=\"JRockit and Duke\" style=\"background-image: none\" alt=\"JRockit and Duke hanging\" src=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2020\/07\/jrockit_duke_love_thumb.png\" border=\"0\"><\/a><\/b><\/p>\n<p>[1]: Sadly, not all of the features in JMAPI got rolled into the standardized API. JMAPI could, for example, change the CPU affinity of the JVM process on the fly, dynamically change the heap size target, and independently (and dynamically) switch the GC to use a nursery or not as well as switch between concurrent and parallel mark and\/or sweep phases. Of course differences in GC capabilities etc required the standardized API to be limited to what made sense to most runtimes. That said, I\u2019m still kinda bummed that it became a JMX API (java.lang.management depending on the javax.management specification), instead of a pure local Java API, which could also have been exposed through JMX. See, for example, the JFR APIs, where there is a local API and also a JMX API.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the last few weeks, there has been a knock-out tournament raging on Twitter, where various Java technologies have battled out which JDK technology is the best. It\u2019s all part of the activities taking place around the celebration of Java turning 25 years. And boy, have those years been interesting. Like many languages in use [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[23,18],"class_list":["post-1230","post","type-post","status-publish","format-standard","hentry","category-java-mission-control-fair-dj","tag-jdk-flight-recorder","tag-jdk-mission-control"],"_links":{"self":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1230"}],"version-history":[{"count":3,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1230\/revisions"}],"predecessor-version":[{"id":1234,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1230\/revisions\/1234"}],"wp:attachment":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}