<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Johannes Bechberger on foojay.io - Friends of OpenJDK</title><link>https://foojayio.github.io/website/today/author/johannes-bechberger/</link><description>Articles written by Johannes Bechberger on foojay.io - Friends of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 13 Apr 2026 06:35:00 +0000</lastBuildDate><atom:link href="https://foojayio.github.io/website/today/author/johannes-bechberger/index.xml" rel="self" type="application/rss+xml"/><item><title>Foojay Podcast #93: Update Your JDK, Read More Code, and Talk to Your Users: Interviews From VoxxedDays Amsterdam</title><link>https://foojayio.github.io/website/today/foojay-podcast-93/</link><pubDate>Mon, 13 Apr 2026 06:35:00 +0000</pubDate><guid>https://foojayio.github.io/website/today/foojay-podcast-93/</guid><description>&lt;p&gt;In this episode of the Foojay Podcast, we&amp;rsquo;re bringing you something special: a full batch of hallway-track conversations recorded live at VoxxedDays Amsterdam.&lt;/p&gt;
&lt;p&gt;Fifteen guests, one conference, and one theme that kept coming back, whether we planned it or not: Java has grown up quietly, steadily, and in ways that still surprise people who haven&amp;rsquo;t looked lately. We talked about migrating between versions, new features in the latest Java releases, authorization done right, AI-assisted coding, cryptography, containers, open-source contributions, GDPR data experiments, and, yes, the things people hate about Java but secretly love.&lt;/p&gt;</description></item><item><title>CAP in the Pocket</title><link>https://foojayio.github.io/website/today/cap-in-the-pocket-developing-java-applications-on-your-phone/</link><pubDate>Mon, 07 Jul 2025 15:27:26 +0000</pubDate><guid>https://foojayio.github.io/website/today/cap-in-the-pocket-developing-java-applications-on-your-phone/</guid><description>&lt;p&gt;Smartphones are more powerful then ever, with processors rivaling old laptops. So let&amp;rsquo;s try to use them like a laptop to develop web-applications on the go.&lt;/p&gt;
&lt;p&gt;Below I&amp;rsquo;ll show you how to do use run and develop a &lt;a href="https://cap.cloud.sap/docs/java/" target="_blank" rel="noopener noreferrer"&gt;CAP Java&lt;/a&gt;
 &lt;a href="https://spring.io/projects/spring-boot" target="_blank" rel="noopener noreferrer"&gt;Spring Boot&lt;/a&gt;
 application on your smartphone and how to run &lt;a href="https://code.visualstudio.com/" target="_blank" rel="noopener noreferrer"&gt;VSCode&lt;/a&gt;
 locally to develop and modify it. This, of course, works only on Android phones, as they are a Linux at their core.
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2025/05/Screenshot-May-8-2025-1_28_58-PM-2000x900.png" alt="" loading="lazy"&gt;
&lt;/p&gt;</description></item><item><title>A Glance into JFR Class and Method Tagging</title><link>https://foojayio.github.io/website/today/a-glance-into-jfr-class-and-method-tagging/</link><pubDate>Mon, 17 Feb 2025 09:26:02 +0000</pubDate><guid>https://foojayio.github.io/website/today/a-glance-into-jfr-class-and-method-tagging/</guid><description>&lt;p&gt;Ever wonder how the JDK Flight Recorder (JFR) keeps track of the classes and methods it has collected for stack traces and more?&lt;/p&gt;
&lt;p&gt;In this short article, I&amp;rsquo;ll explore JFR tagging and how it works in the OpenJDK.&lt;/p&gt;
&lt;h2 id="h2-0-tags"&gt;Tags&lt;/h2&gt;
&lt;p&gt;JFR files consist of self-contained chunks. Every chunk contains:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;metadata&lt;/li&gt;
&lt;li&gt;events&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mail.openjdk.org/pipermail/hotspot-jfr-dev/2020-February/001154.html" target="_blank" rel="noopener noreferrer"&gt;mappings of IDs to actual values&lt;/a&gt;
, the IDs are used in the events in place of stack traces, classes, methods, strings, &amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The maximum chunk size is usually 12MB, but you can configure it:&lt;/p&gt;</description></item><item><title>The slow Death of the onjcmd Debugger Feature</title><link>https://foojayio.github.io/website/today/the-slow-death-of-the-onjcmd-debugger-feature/</link><pubDate>Sat, 18 Jan 2025 10:47:30 +0000</pubDate><guid>https://foojayio.github.io/website/today/the-slow-death-of-the-onjcmd-debugger-feature/</guid><description>&lt;p&gt;Almost to the day, one and a quarter years ago, I published my blog post called &lt;a href="https://foojayio.github.io/website/today/level-up-your-java-debugging-skills-with-on-demand-debugging/"&gt;Level-up your Java Debugging Skills with on-demand Debugging&lt;/a&gt;
. In this artucle, I wrote about multiple rarely known and rarely used features of the Java debugging agent, including the onjcmd feature.{#block-a9c8a1e1-3105-4ea3-80ff-84fea4726402}&lt;/p&gt;
&lt;p&gt;To quote my own article:{#block-a9c8a1e1-3105-4ea3-80ff-84fea4726402}&lt;/p&gt;
&lt;blockquote&gt;
&lt;h2 id="block-34217269-4b27-4330-a4cb-2c66085f9a1c"&gt;JCmd triggered debugging&lt;/h2&gt;
&lt;p&gt;There are often cases where the code that you want to debug is executed later in your program&amp;rsquo;s run or after a specific issue appears. So don&amp;rsquo;t waste time running the debugging session from the start of your program, but use the &lt;code&gt;onjcmd=y&lt;/code&gt; option to tell the JDWP agent to wait with the debugging session till it is triggered via &lt;code&gt;jcmd&lt;/code&gt;.{#block-19cdbfac-1c23-4648-af2f-6bd2f85951c2}&lt;/p&gt;</description></item><item><title>Who instruments the instrumenters?</title><link>https://foojayio.github.io/website/today/who-instruments-the-instrumenters/</link><pubDate>Thu, 30 May 2024 16:25:45 +0000</pubDate><guid>https://foojayio.github.io/website/today/who-instruments-the-instrumenters/</guid><description>&lt;p&gt;Have you ever wondered how libraries like &lt;a href="https://spring.io/" target="_blank" rel="noopener noreferrer"&gt;Spring&lt;/a&gt;
 and &lt;a href="https://site.mockito.org/" target="_blank" rel="noopener noreferrer"&gt;Mockito&lt;/a&gt;
 modify your code at run-time to implement all their advanced features?&lt;/p&gt;
&lt;p&gt;Wouldn&amp;rsquo;t it be cool to get a peek behind the curtains?&lt;/p&gt;
&lt;p&gt;This is the premise of my &lt;a href="https://github.com/parttimenerd/meta-agent" target="_blank" rel="noopener noreferrer"&gt;meta-agent&lt;/a&gt;
, a Java agent to instrument instrumenters, to get these insights and what this blog post is about.&lt;/p&gt;
&lt;p&gt;This article is a collaboration with &lt;a href="https://www.linkedin.com/in/mika%C3%ABl-francoeur/" target="_blank" rel="noopener noreferrer"&gt;Mikaël Francoeur&lt;/a&gt;
, who had the idea for the meta-agent and wrote most of this post. So it&amp;rsquo;s my first ever post-collaboration. But I start with a short introduction to the agent itself before Mikaël takes over with real-world examples.&lt;/p&gt;</description></item><item><title>Hello eBPF: XDP-based Packet Filter (9)</title><link>https://foojayio.github.io/website/today/hello-ebpf-xdp-based-packet-filter-9/</link><pubDate>Mon, 13 May 2024 07:13:38 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-xdp-based-packet-filter-9/</guid><description>&lt;p&gt;&lt;strong&gt;Welcome back to my &lt;a href="https://mostlynerdless.de/blog/tag/hello-ebpf/" target="_blank" rel="noopener noreferrer"&gt;series on ebpf&lt;/a&gt;
. In the last blog post, we learned how &lt;a href="https://mostlynerdless.de/blog/2024/04/09/hello-ebpf-generating-c-code-8/" target="_blank" rel="noopener noreferrer"&gt;annotation processors can&lt;/a&gt;
generate C code, simplifying writing eBPF applications.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This week, we&amp;rsquo;ll use this work together with new support for XDP to create a simple package blocker for eBPF (&lt;a href="https://github.com/parttimenerd/hello-ebpf/blob/main/bpf/src/main/java/me/bechberger/ebpf/samples/XDPPacketFilter.java" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
):&lt;/p&gt;
&lt;pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""&gt;./run_bpf.sh XDPPacketFilter twitter.com&lt;/pre&gt;
&lt;p&gt;This blocks all incoming IPv4 packages from &lt;code&gt;twitter.com&lt;/code&gt;. We see how it works in this blog post. First, we start with some background on networking and explain what XDP is.&lt;/p&gt;</description></item><item><title>Hello eBPF: Generating C Code (8)</title><link>https://foojayio.github.io/website/today/hello-ebpf-generating-c-code-8/</link><pubDate>Wed, 24 Apr 2024 13:11:40 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-generating-c-code-8/</guid><description>&lt;p&gt;&lt;strong&gt;Welcome back to my &lt;a href="https://mostlynerdless.de/blog/tag/hello-ebpf/" target="_blank" rel="noopener noreferrer"&gt;series on ebpf&lt;/a&gt;
. In the last article, we learned how to&lt;a href="https://mostlynerdless.de/blog/2024/03/25/hello-ebpf-auto-layouting-structs-7/" target="_blank" rel="noopener noreferrer"&gt;auto-layout struct members and auto-generate BPFStructTypes for annotated Java records&lt;/a&gt;
. We&amp;rsquo;re going to extend this work today.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This is a rather short article, but the implementation and fixing all the bugs took far more time then expected.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id="h2-0-generating-struct-definitions"&gt;Generating Struct Definitions&lt;/h2&gt;
&lt;p&gt;We saw in the last article how powerful Java annotation processing is for generating Java code; this week, we&amp;rsquo;ll tackle the generation of C code: In the previous article, we still had to write the C struct and map definitions ourselves, but writing&lt;/p&gt;</description></item><item><title>Hello eBPF: Auto Layouting Structs (7)</title><link>https://foojayio.github.io/website/today/hello-ebpf-auto-layouting-structs-7/</link><pubDate>Sun, 14 Apr 2024 16:19:50 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-auto-layouting-structs-7/</guid><description>&lt;p&gt;&lt;strong&gt;Welcome back to my &lt;a href="https://mostlynerdless.de/blog/tag/hello-ebpf/" target="_blank" rel="noopener noreferrer"&gt;series on ebpf&lt;/a&gt;
. In the last article, &lt;a href="https://mostlynerdless.de/blog/2024/03/12/hello-ebpf-ring-buffers-in-libbpf-6/" target="_blank" rel="noopener noreferrer"&gt;we learned how to use ring buffers with libbpf&lt;/a&gt;
 for efficient communication. This week, we&amp;rsquo;re looking into the memory layout and alignment of structs transferred between the kernel and user-land.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Alignment is essential; it specifies how the compiler layouts the structs and variables and where to put the data in memory. Take, for example, the struct that we defined in the previous article in the &lt;a href="https://github.com/parttimenerd/hello-ebpf/blob/main/bpf/src/main/java/me/bechberger/ebpf/samples/RingSample.java" target="_blank" rel="noopener noreferrer"&gt;RingSample&lt;/a&gt;
:&lt;/p&gt;</description></item><item><title>To Brussels, Canada and back</title><link>https://foojayio.github.io/website/today/to-brussels-canada-and-back/</link><pubDate>Tue, 26 Mar 2024 10:53:11 +0000</pubDate><guid>https://foojayio.github.io/website/today/to-brussels-canada-and-back/</guid><description>&lt;p&gt;Last year was my first year blogging, speaking at conferences, meeting incredible people, and seeing places I&amp;rsquo;ve never been before.&lt;/p&gt;
&lt;p&gt;It was at times quite arduous but at the same time energizing, as you can read in my post Looking back on one year of speaking and blogging. I didn&amp;rsquo;t want it to be a one-off year, so I dutifully started a new article series on eBPF and applied for conferences&amp;hellip;&lt;/p&gt;</description></item><item><title>Hello eBPF: Ring buffers in libbpf (6)</title><link>https://foojayio.github.io/website/today/hello-ebpf-ring-buffers-in-libbpf-6/</link><pubDate>Tue, 19 Mar 2024 17:54:22 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-ring-buffers-in-libbpf-6/</guid><description>&lt;p&gt;&lt;strong&gt;Welcome back to my article series on eBPF. Some weeks ago, &lt;a href="https://foojayio.github.io/website/today/hello-ebpf-developing-ebpf-apps-in-java-1/"&gt;I got started in using libbpf instead of libbcc&lt;/a&gt;
. This week, I show you how to use ring buffers, port the code from Ansil H&amp;rsquo;s blog post eBPF for Linux Admins: Part IX from C to Java, and add tests to the underlying map implementation.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;My libbpf-based implementation advances slower than the bcc-based, as I thoroughly test all added functionality and develop a proper Java API, not just a clone.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Hello eBPF: First steps with libbpf (5)</title><link>https://foojayio.github.io/website/today/hello-ebpf-first-steps-with-libbpf-5/</link><pubDate>Thu, 07 Mar 2024 13:51:35 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-first-steps-with-libbpf-5/</guid><description>&lt;p&gt;&lt;strong&gt;Welcome back to my blog series on eBPF. Two weeks ago, I showed you &lt;a href="https://mostlynerdless.de/blog/2024/02/12/hello-ebpf-tail-calls-and-your-first-ebpf-application-4/" target="_blank" rel="noopener noreferrer"&gt;how to write your own eBPF application using my hello-ebpf library based on libbcc&lt;/a&gt;
. This week, I show you why using libbcc is not the best idea and start working with the newer &lt;a href="https://libbpf.readthedocs.io/en/latest/" target="_blank" rel="noopener noreferrer"&gt;libbpf&lt;/a&gt;
.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With my current libbcc-based approach, we essentially embed the executed eBPF program into our programs as a string into our applications and compile them on the fly for every run:&lt;/p&gt;</description></item><item><title>Hello eBPF: Tail calls and your first eBPF application (4)</title><link>https://foojayio.github.io/website/today/hello-ebpf-tail-calls-and-your-first-ebpf-application-4/</link><pubDate>Fri, 23 Feb 2024 08:44:51 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-tail-calls-and-your-first-ebpf-application-4/</guid><description>&lt;p&gt;Welcome back to my series on eBPF. Two weeks ago, I showed you &lt;a href="https://foojayio.github.io/website/today/hello-ebpf-recording-data-in-event-buffers-3/"&gt;how to use perf event buffers to stream data from the eBPF program to the Java application&lt;/a&gt;
.&lt;/p&gt;
&lt;p&gt;This week, we will finish chapter 2 of the Learning eBPF book, learn how to use tail calls and the hello-ebpf project as a library and implement one of the book&amp;rsquo;s exercises.&lt;/p&gt;
&lt;p&gt;We start with function and tail calls:&lt;/p&gt;
&lt;h2 id="h2-0-function-calls"&gt;Function Calls&lt;/h2&gt;
&lt;p&gt;Regular C programs are divided into functions that call each other; so far in this series, all our eBPF programs consisted of just a single function that calls kernel functions. But can we call other eBPF functions? End of 2017, Daniel Borkman et al. introduced the ability to call other functions defined in eBPF:&lt;/p&gt;</description></item><item><title>Is JDWP's onjcmd feature worth using?</title><link>https://foojayio.github.io/website/today/is-jdwps-onjcmd-feature-worth-using/</link><pubDate>Mon, 12 Feb 2024 11:25:22 +0000</pubDate><guid>https://foojayio.github.io/website/today/is-jdwps-onjcmd-feature-worth-using/</guid><description>&lt;p&gt;A few months ago, I told you about the onjcmd feature in my blog post &lt;a href="https://foojayio.github.io/website/today/level-up-your-java-debugging-skills-with-on-demand-debugging/"&gt;Level-up your Java Debugging Skills with on-demand Debugging&lt;/a&gt;
 (which is coming to JavaLand 2024). The short version is that adding onjcmd=y to the list of JDWP options allows you to delay accepting the incoming connection request in the JDWP agent until &lt;code&gt;jcmd &amp;lt;JVM pid&amp;gt; VM.start_java_debugging&lt;/code&gt; is called.&lt;/p&gt;
&lt;p&gt;The main idea is that the JDWP agent&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;only listens on the debugging port after it is triggered, which could have some security benefits&lt;/li&gt;
&lt;li&gt;and that the JDWP agent causes less overhead while waiting, compared to just accepting connections from the beginning.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first point is debatable; one can find arguments for and against it. But for the second point, we can run some benchmarks. After renewed discussions, I started benchmarking to conclude whether the onjcmd feature improves on-demand debugging performance. &lt;em&gt;Spoiler alert: It doesn&amp;rsquo;t.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Hello eBPF: Recording data in event buffers (3)</title><link>https://foojayio.github.io/website/today/hello-ebpf-recording-data-in-event-buffers-3/</link><pubDate>Fri, 02 Feb 2024 14:45:02 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-recording-data-in-event-buffers-3/</guid><description>&lt;p&gt;&lt;strong&gt;Welcome back to my article series on eBPF. Last week, I showed you how the &lt;a href="https://foojayio.github.io/website/today/hello-ebpf-recording-data-in-basic-ebpf-maps-2/"&gt;eBPF program and Java application can communicate using eBPF maps&lt;/a&gt;
. This allowed us to write an application that counts the number of &lt;code&gt;execve&lt;/code&gt; calls per user.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This week, I&amp;rsquo;ll show you briefly how to use another kind of eBPF maps, the perf event buffer, and run tests with docker and &lt;a href="https://junit.org/junit5/docs/current/user-guide/" target="_blank" rel="noopener noreferrer"&gt;JUnit 5&lt;/a&gt;
.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This article is shorter than the previous one as I&amp;rsquo;m preparing for the OpenJDK committers workshop in Brussels and my &lt;a href="https://fosdem.org/2024/schedule/speaker/WS77F8/" target="_blank" rel="noopener noreferrer"&gt;Python and Java DevRoom talks&lt;/a&gt;
 at FOSDEM. I&amp;rsquo;m happy to meet my readers; say hi when you&amp;rsquo;re there.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Hello eBPF: Recording data in basic eBPF maps (2)</title><link>https://foojayio.github.io/website/today/hello-ebpf-recording-data-in-basic-ebpf-maps-2/</link><pubDate>Thu, 18 Jan 2024 15:50:44 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-recording-data-in-basic-ebpf-maps-2/</guid><description>&lt;p&gt;Welcome back to my article series on eBPF.&lt;/p&gt;
&lt;p&gt;Last week, I introduced &lt;a href="https://mostlynerdless.de/blog/2023/12/31/hello-ebpf-developing-ebpf-apps-in-java-1/" target="_blank" rel="noopener noreferrer"&gt;eBPF, the series, and the project&lt;/a&gt;
 and showed how you can write a &lt;a href="https://github.com/parttimenerd/hello-ebpf/blob/spotless/bcc/src/main/java/me/bechberger/ebpf/samples/chapter2/HelloWorld.java" target="_blank" rel="noopener noreferrer"&gt;simple eBPF application&lt;/a&gt;
 with Java that prints &amp;ldquo;Hello World!&amp;rdquo; whenever a process calls &lt;code&gt;execve&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""&gt;public class HelloWorld {
 public static void main(String[] args) {
 try (BPF b = BPF.builder("""
 int hello(void *ctx) {
 bpf_trace_printk("Hello, World!");
 return 0;
 }
 """).build()) {
 var syscall = b.get_syscall_fnname("execve");
 b.attach_kprobe(syscall, "hello");
 b.trace_print();
 }
 }
}&lt;/pre&gt;
&lt;p&gt;But what if we want to send more information from our eBPF program to our userland application than just some logs?&lt;/p&gt;</description></item><item><title>Hello eBPF: Developing eBPF Apps in Java (1)</title><link>https://foojayio.github.io/website/today/hello-ebpf-developing-ebpf-apps-in-java-1/</link><pubDate>Tue, 09 Jan 2024 16:34:56 +0000</pubDate><guid>https://foojayio.github.io/website/today/hello-ebpf-developing-ebpf-apps-in-java-1/</guid><description>&lt;p&gt;&lt;strong&gt;eBPF allows you to attach programs directly to hooks in the Linux kernel without loading kernel modules, like hooks for networking or executing programs.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This has historically been used for writing custom package filters in firewalls. Still, nowadays, it is used for monitoring and tracing, becoming an ever more critical building block of modern observability tools. To quote from &lt;a href="https://ebpf.io/what-is-ebpf/" target="_blank" rel="noopener noreferrer"&gt;ebpf.io&lt;/a&gt;
:&lt;/p&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;figure class="aligncenter size-full is-resized"&gt;
 &lt;img decoding="async" src="https://mostlynerdless.de/wp-content/uploads/2023/12/image-20.png" alt="" class="wp-image-1469" style="width:524px;height:auto"&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;Historically, the operating system has always been an ideal place to implement observability, security, and networking functionality due to the kernel&amp;rsquo;s privileged ability to oversee and control the entire system. At the same time, an operating system kernel is hard to evolve due to its central role and high requirement towards stability and security. The rate of innovation at the operating system level has thus traditionally been lower compared to functionality implemented outside of the operating system.&lt;a href="https://ebpf.io/static/e293240ecccb9d506587571007c36739/f2674/overview.png" target="_blank" rel="noopener noreferrer"&gt;&lt;/a&gt;
&lt;/p&gt;</description></item><item><title>Looking Back on One Year of Speaking and Blogging</title><link>https://foojayio.github.io/website/today/looking-back-on-one-year-of-speaking-and-blogging/</link><pubDate>Fri, 05 Jan 2024 17:49:04 +0000</pubDate><guid>https://foojayio.github.io/website/today/looking-back-on-one-year-of-speaking-and-blogging/</guid><description>&lt;p&gt;&lt;strong&gt;2023 was an adventurous year for me: I came into my blogging rhythm, blogging every one to two weeks, resulting in 39 articles, many of them on Foojay.io, spoke at my first conferences, around 14 overall, 22 if you include JUGs and online conferences, and continued working on my &lt;a href="https://mostlynerdless.de/blog/2023/12/04/profiling-maven-projects-with-my-intellij-profiler-plugin/" target="_blank" rel="noopener noreferrer"&gt;IntelliJ plugin&lt;/a&gt;
, as well as my proposal for a &lt;a href="https://openjdk.org/jeps/435" target="_blank" rel="noopener noreferrer"&gt;new profiling API&lt;/a&gt;
.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This article is a recollection of the year&amp;rsquo;s highlights. If you want a complete list of my presentations, visit my &lt;a href="https://mostlynerdless.de/talks/" target="_blank" rel="noopener noreferrer"&gt;Talks&lt;/a&gt;
 page or the &lt;a href="https://github.com/SAP/SapMachine/wiki/Presentations" target="_blank" rel="noopener noreferrer"&gt;Presentations&lt;/a&gt;
 page in the SapMachine Wiki.&lt;/p&gt;</description></item><item><title>Using AI to Create JFR Event Descriptions</title><link>https://foojayio.github.io/website/today/using-ai-to-create-jfr-event-descriptions/</link><pubDate>Fri, 29 Dec 2023 05:42:16 +0000</pubDate><guid>https://foojayio.github.io/website/today/using-ai-to-create-jfr-event-descriptions/</guid><description>&lt;p&gt;JFR (JDK Flight Recorder) is the default profiler for OpenJDK (see &lt;a href="https://mostlynerdless.de/blog/category/java-servicability/profiling/" target="_blank" rel="noopener noreferrer"&gt;my other blog posts&lt;/a&gt;
 for more information).&lt;/p&gt;
&lt;p&gt;What makes JFR stand out from the other profilers is the ability to log many, many different events that contain lots of information, like information on class loading, JIT compilation, and garbage collection.&lt;/p&gt;
&lt;p&gt;You can see a list of all available events on my &lt;a href="https://sap.github.io/SapMachine/jfrevents/" target="_blank" rel="noopener noreferrer"&gt;JFR Event Collection&lt;/a&gt;
 website:
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/12/image-10-2000x1604.png" alt="" loading="lazy"&gt;
&lt;/p&gt;
&lt;p&gt;This website gives an overview of the events, with descriptions from the OpenJDK, their properties, examples, configurations, and the JDK versions in which every event is present. However, few descriptions are available, and the available texts are mostly single sentences.&lt;/p&gt;</description></item><item><title>Writing C Code in Java</title><link>https://foojayio.github.io/website/today/writing-c-code-in-java/</link><pubDate>Wed, 20 Dec 2023 09:21:56 +0000</pubDate><guid>https://foojayio.github.io/website/today/writing-c-code-in-java/</guid><description>&lt;p&gt;&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/12/panama-2000x981.png" alt="" loading="lazy"&gt;
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Foreign Function &amp;amp; Memory API (also called Project Panama) has come a long way since it started. You can find the latest version implemented in JDK 21 as a preview feature (use &lt;code&gt;--enable-preview&lt;/code&gt; to enable it) which is specified by the &lt;a href="https://openjdk.org/jeps/454" target="_blank" rel="noopener noreferrer"&gt;JEP 454&lt;/a&gt;
:&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;By efficiently invoking foreign functions (i.e., code outside the JVM), and by safely accessing foreign memory (i.e., memory not managed by the JVM), the API enables Java programs to call native libraries and process native data without the brittleness and danger of JNI.
&lt;a href="https://openjdk.org/jeps/454" target="_blank" rel="noopener noreferrer"&gt;JEP 454&lt;/a&gt;
&lt;/p&gt;</description></item><item><title>Profiling Maven Projects with my IntelliJ Profiler Plugin</title><link>https://foojayio.github.io/website/today/profiling-maven-projects-with-my-intellij-profiler-plugin/</link><pubDate>Thu, 14 Dec 2023 10:41:34 +0000</pubDate><guid>https://foojayio.github.io/website/today/profiling-maven-projects-with-my-intellij-profiler-plugin/</guid><description>&lt;h3 id="h3-0-or-i-just-released-version-0-0-11-with-a-cool-new-feature-that-i-can-t-wait-to-tell-you-about"&gt;Or: I just released version 0.0.11 with a cool new feature that I can&amp;rsquo;t wait to tell you about&amp;hellip;&lt;/h3&gt;
&lt;p&gt;According to the recent &lt;a href="https://www.jetbrains.com/lp/devecosystem-2023/java/" target="_blank" rel="noopener noreferrer"&gt;JetBrains survey&lt;/a&gt;
, most people use Maven as their build system and build Spring Boot applications with Java. Yet my profiling plugin for IntelliJ only supports profiling pure Java run configurations. Configurations where the JVM gets passed the main class to run. This is great for tiny examples where you directly right-click on the &lt;code&gt;main&lt;/code&gt; method and profile the whole application using the context menu:
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/12/image-2.png" alt="" loading="lazy"&gt;
&lt;/p&gt;</description></item><item><title>Who Killed the JVM? Attaching a Debugger Twice</title><link>https://foojayio.github.io/website/today/who-killed-the-jvm-attaching-a-debugger-twice/</link><pubDate>Wed, 06 Dec 2023 17:17:47 +0000</pubDate><guid>https://foojayio.github.io/website/today/who-killed-the-jvm-attaching-a-debugger-twice/</guid><description>&lt;p&gt;A few weeks back, I told you about on-demand debugging in my &lt;a href="https://mostlynerdless.de/blog/2023/10/03/level-up-your-java-debugging-skills-with-on-demand-debugging/" target="_blank" rel="noopener noreferrer"&gt;Level-up your Java Debugging Skills with on-demand Debugging&lt;/a&gt;
 blog post, enabling you to delay a debugging session until:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You gave orders via &lt;code&gt;jcmd&lt;/code&gt; (&lt;code&gt;onjcmd=y&lt;/code&gt; option), a feature contributed by the &lt;a href="https://sapmachine.io" target="_blank" rel="noopener noreferrer"&gt;SapMachine&lt;/a&gt;
 team&lt;/li&gt;
&lt;li&gt;the program threw a specific exception (&lt;code&gt;onthrow=&amp;lt;exception&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The program threw an uncaught exception (&lt;code&gt;onuncaught=y&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is quite useful because the JDWP agent has to do substantial initialization before it can start listening for the attaching debugger:&lt;/p&gt;</description></item><item><title>Custom Events in the Blocky World: Using JFR in Minecraft</title><link>https://foojayio.github.io/website/today/custom-events-in-the-blocky-world-using-jfr-in-minecraft/</link><pubDate>Tue, 28 Nov 2023 19:12:50 +0000</pubDate><guid>https://foojayio.github.io/website/today/custom-events-in-the-blocky-world-using-jfr-in-minecraft/</guid><description>&lt;p&gt;I was searching for some JFR-related settings on the internet when I stumbled upon the &lt;a href="https://minecraft.fandom.com/wiki/Commands/jfr" target="_blank" rel="noopener noreferrer"&gt;&lt;code&gt;/jfr&lt;/code&gt; command&lt;/a&gt;
 that exists in &lt;a href="https://www.minecraft.net" target="_blank" rel="noopener noreferrer"&gt;Minecraft&lt;/a&gt;
:&lt;/p&gt;
&lt;figure class="aligncenter size-full is-resized"&gt;
 &lt;a target="_blank" href="https://minecraft.fandom.com/wiki/Commands/jfr"&gt;&lt;img decoding="async" src="https://mostlynerdless.de/wp-content/uploads/2023/11/image-2.png" alt="" class="wp-image-1298" style="width:614px;height:auto"&gt;&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;This, of course, intrigued me, especially as Minecraft apparently adds some custom JFR events:
&lt;a href="https://minecraft.fandom.com/wiki/Commands/jfr" target="_blank" rel="noopener noreferrer"&gt;&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/11/image-3.png" alt="" loading="lazy"&gt;
&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;So I had to check it out. I downloaded and started the &lt;a href="https://www.minecraft.net/en-us/download/server" target="_blank" rel="noopener noreferrer"&gt;Java server&lt;/a&gt;
, got a demo account, and connected to my local instance. &lt;em&gt;This works with a demo account when you launch the demo world, enable the cheat mode in the settings, kick yourself via &amp;ldquo;/kick @p,&amp;rdquo; and then select your own server. I found this via &lt;a href="https://bugs.mojang.com/browse/MC-138478" target="_blank" rel="noopener noreferrer"&gt;this bug report&lt;/a&gt;
.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Custom JFR Events: A Short Introduction</title><link>https://foojayio.github.io/website/today/custom-jfr-events-a-short-introduction/</link><pubDate>Sun, 26 Nov 2023 21:08:03 +0000</pubDate><guid>https://foojayio.github.io/website/today/custom-jfr-events-a-short-introduction/</guid><description>&lt;p&gt;&lt;strong&gt;JDK Flight Recorder (JFR) is one of the two prominent open-source profilers for the OpenJDK (besides &lt;a href="https://github.com/async-profiler/async-profiler" target="_blank" rel="noopener noreferrer"&gt;async-profiler&lt;/a&gt;
).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It offers many features (see &lt;a href="https://mostlynerdless.de/profiling-talks/" target="_blank" rel="noopener noreferrer"&gt;Profiling Talks&lt;/a&gt;
) and the ability to observe lots of information by recording over one hundred different events.&lt;/p&gt;
&lt;p&gt;If you want to know more about the existing events, visit my &lt;a href="https://sapmachine.io/jfrevents" target="_blank" rel="noopener noreferrer"&gt;JFR Event Collection&lt;/a&gt;
 website (&lt;a href="https://mostlynerdless.de/blog/2022/12/06/jfr-event-collection/" target="_blank" rel="noopener noreferrer"&gt;related blog post&lt;/a&gt;
):&lt;br&gt;
&lt;a href="https://sapmachine.io/jfrevents" target="_blank" rel="noopener noreferrer"&gt;&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/11/image.png" alt="" loading="lazy"&gt;
&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;Besides these built-in events, JFR allows you to implement your events to record custom information directly in your profiling file.&lt;/p&gt;</description></item><item><title>Loom is just HyperThreading in Java</title><link>https://foojayio.github.io/website/today/loom-is-just-hyperthreading-in-java/</link><pubDate>Tue, 14 Nov 2023 10:54:06 +0000</pubDate><guid>https://foojayio.github.io/website/today/loom-is-just-hyperthreading-in-java/</guid><description>&lt;p&gt;While sitting in &lt;a href="https://horstmann.com/unblog/2023-09-19/index.html" target="_blank" rel="noopener noreferrer"&gt;Cay Horstmann&lt;/a&gt;
&amp;rsquo;s &lt;a href="https://baselone.ch/speech.html?id=BEB1A232-BA37-4619-A7F9-33802755DFEB" target="_blank" rel="noopener noreferrer"&gt;&amp;ldquo;Looming Changes in Java Concurrency&amp;rdquo; talk at BaselOne&lt;/a&gt;
, I had an epiphany: Aren&amp;rsquo;t virtual threads with Loom just a version of HyperThreading on the JVM?&lt;br&gt;
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/10/ht_vs_vt_pyramid-1-2000x1125.png" alt="" loading="lazy"&gt;
&lt;/p&gt;
&lt;p&gt;Both try to utilize a computation resource fully, be it hardware core or platform thread, by multiplexing multiple tasks onto it, despite many tasks waiting regularly for IO operations to complete:
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/10/ht_vs_vt_interleaving-2000x560.png" alt="" loading="lazy"&gt;
&lt;/p&gt;
&lt;p&gt;When one task waits, another can be scheduled, improving overall throughput. This works especially well when longer IO operations follow short bursts of computation.&lt;/p&gt;</description></item><item><title>Putting JFR into Context</title><link>https://foojayio.github.io/website/today/putting-jfr-into-context/</link><pubDate>Thu, 02 Nov 2023 14:03:25 +0000</pubDate><guid>https://foojayio.github.io/website/today/putting-jfr-into-context/</guid><description>&lt;p&gt;&lt;strong&gt;Have you ever wanted to bring your JFR events into context? Adding information on sessions, user IDs, and more can improve your ability to make sense of all the events in your profile.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Currently, we can only add context by creating custom JFR events, as I presented in my &lt;a href="https://mostlynerdless.de/profiling-talks/" target="_blank" rel="noopener noreferrer"&gt;Profiling Talks&lt;/a&gt;
:&lt;/p&gt;
&lt;figure class="wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio"&gt;
 &lt;div class="wp-block-embed__wrapper"&gt;
 &lt;iframe title="Unleash the Power of Open Source Java Profilers - Johannes Bechberger" src="https://player.vimeo.com/video/861946709?dnt=1&amp;amp;app_id=122963" width="500" height="281" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write"&gt;&lt;/iframe&gt;
 &lt;/div&gt;
 &lt;figcaption class="wp-element-caption"&gt;
 More here: &lt;a target="_blank" href="https://mostlynerdless.de/profiling-talks/"&gt;https://mostlynerdless.de/profiling-talks/&lt;/a&gt;
 &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;We can use these custom events to store away the information and later relate them to all the other events by using the event&amp;rsquo;s time, duration, and thread. This works out-of-the-box but has one major problem: Relating events is quite fuzzy, as time stamps are not as accurate (see JFR Timestamps and System.nanoTime), and we do all of this in post-processing.&lt;/p&gt;</description></item><item><title>JDWP, onthrow and a mysterious error</title><link>https://foojayio.github.io/website/today/jdwp-onthrow-and-a-mysterious-error/</link><pubDate>Thu, 26 Oct 2023 13:44:01 +0000</pubDate><guid>https://foojayio.github.io/website/today/jdwp-onthrow-and-a-mysterious-error/</guid><description>&lt;p&gt;&lt;strong&gt;In my previous Java-related blog post called &lt;a href="https://foojayio.github.io/website/today/level-up-your-java-debugging-skills-with-on-demand-debugging/"&gt;Level-up your Java Debugging Skills with on-demand Debugging&lt;/a&gt;
, I showed you how to use the &lt;code&gt;onthrow&lt;/code&gt; option of the JDWP agent to start the debugging session on the first throw of a specific exception.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This gave us a mysterious error in JDB:
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/10/image-3.png" alt="" loading="lazy"&gt;
&lt;/p&gt;
&lt;p&gt;And I asked if somebody had any ideas. No one had, but I was at Devoxx Belgium and happened to talk with &lt;a href="https://shipilev.net/" target="_blank" rel="noopener noreferrer"&gt;Aleksey Shipilev&lt;/a&gt;
 about it at the Corretto booth:
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/10/F7hNsheWUAA0Y46-2000x1500.jpg" alt="" loading="lazy"&gt;
 Two OpenJDK developers having fun at Devoxx: Investigating a jdb bug with Shipilev&lt;br&gt;
in the Coretto booth (&lt;a href="https://twitter.com/parttimen3rd/status/1709201492115095904" target="_blank" rel="noopener noreferrer"&gt;Tweet&lt;/a&gt;
)&lt;/p&gt;</description></item><item><title>Level-up your Java Debugging Skills with on-demand Debugging</title><link>https://foojayio.github.io/website/today/level-up-your-java-debugging-skills-with-on-demand-debugging/</link><pubDate>Mon, 16 Oct 2023 14:21:24 +0000</pubDate><guid>https://foojayio.github.io/website/today/level-up-your-java-debugging-skills-with-on-demand-debugging/</guid><description>&lt;p&gt;&lt;strong&gt;Debugging is one of the most common tasks in software development, so one would assume that all features of debuggers have ample coverage in tutorials and guides.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Yet there are three hidden gems of the Java Debugging (JDWP) agent that allow you to delay the start of the debugging session until&amp;hellip;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;you gave orders via &lt;code&gt;jcmd&lt;/code&gt; (&lt;code&gt;onjcmd=y&lt;/code&gt; option)&lt;/li&gt;
&lt;li&gt;the program threw a specific exception (&lt;code&gt;onthrow=&amp;lt;exception&amp;gt;&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;the program threw an uncaught exception (&lt;code&gt;onuncaught=y&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before I tell you more about the specific options, I want to start with the basics of how to apply them.&lt;/p&gt;</description></item><item><title>Report of My Trip to JavaZone and Northern Germany</title><link>https://foojayio.github.io/website/today/report-of-my-trip-to-javazone-and-northern-germany/</link><pubDate>Mon, 02 Oct 2023 08:44:28 +0000</pubDate><guid>https://foojayio.github.io/website/today/report-of-my-trip-to-javazone-and-northern-germany/</guid><description>&lt;p&gt;Between 2nd and 17th September, I gave three talks in three different cities:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://2023.javazone.no/" target="_blank" rel="noopener noreferrer"&gt;JavaZone Oslo&lt;/a&gt;
, 7th September: Unleash the Power Of Open-Source Profilers (&lt;a href="https://www.infoq.com/articles/open-source-java-profilers/" target="_blank" rel="noopener noreferrer"&gt;InfoQ article&lt;/a&gt;
)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://javaforumnord.de/2023/programm/" target="_blank" rel="noopener noreferrer"&gt;Java Forum Nord&lt;/a&gt;
 Hannover, 12th September: Unleash the power of Open-Source Java Profilers&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codetalks.de/program#talk-1748?event=8" target="_blank" rel="noopener noreferrer"&gt;code.talks&lt;/a&gt;
 Hamburg, 14th September: Writing a Java Profiler in Pure Java (&lt;a href="https://mostlynerdless.de/blog/2023/03/27/writing-a-profiler-in-240-lines-of-pure-java/" target="_blank" rel="noopener noreferrer"&gt;blog post&lt;/a&gt;
)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I traveled from Karlsruhe to Oslo (via Stuttgart Airport) and from Oslo to Hanover via plane, then to Hamburg, Hanover, back to Hamburg, and the end via Bonn back to Karlsruhe via train:&lt;/p&gt;</description></item><item><title>C2 Might Be Slowing Down Your Builds</title><link>https://foojayio.github.io/website/today/c2-might-be-slowing-down-your-builds/</link><pubDate>Thu, 28 Sep 2023 09:55:13 +0000</pubDate><guid>https://foojayio.github.io/website/today/c2-might-be-slowing-down-your-builds/</guid><description>&lt;p&gt;&lt;strong&gt;At the JavaForumNord two weeks ago, I had a friendly chat with Karl Heinz Marbaise (Chairman of the Apache Maven Project), where he mentioned that he wanted to start profiling Maven. This sounded interesting, so I started looking into the performance and bottlenecks of Maven. I began by using the Maven build of &lt;a href="https://github.com/apache/maven" target="_blank" rel="noopener noreferrer"&gt;maven&lt;/a&gt;
 itself as a starting point (excluding the tests). The following is my first observation related to Maven builds in CIs.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Taming the Bias: Unbiased Safepoint-Based Stack Walking</title><link>https://foojayio.github.io/website/today/taming-the-bias-unbiased-safepoint-based-stack-walking/</link><pubDate>Thu, 17 Aug 2023 14:00:34 +0000</pubDate><guid>https://foojayio.github.io/website/today/taming-the-bias-unbiased-safepoint-based-stack-walking/</guid><description>&lt;p&gt;&lt;strong&gt;Walking only at safepoints has advantages. The main one is that you aren&amp;rsquo;t walking the stack in a signal handler but synchronously to the executed program. Therefore you can allocate memory, acquire locks and rematerialize virtual thread / Loom frames. The latter is significant because virtual threads are &lt;em&gt;the&lt;/em&gt; new Java feature that cannot support using signal-handler-based APIs like AsyncGetCallTrace.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This article is based on the ideas of Erik Österlund, and the second one is related to these new ideas. The first one is &lt;a href="https://mostlynerdless.de/blog/2023/08/07/asyncgetcalltrace-reworked-frame-by-frame-with-an-iterative-touch/" target="_blank" rel="noopener noreferrer"&gt;AsyncGetCallTrace Reworked: Frame by Frame with an Iterative Touch!&lt;/a&gt;
, which you should read before continuing with this post. For a refresher on safepoints, please read &lt;a href="https://mostlynerdless.de/blog/2023/07/31/the-inner-workings-of-safepoints/" target="_blank" rel="noopener noreferrer"&gt;The Inner Workings of Safepoints&lt;/a&gt;
.&lt;/p&gt;</description></item><item><title>AsyncGetCallTrace Reworked: Frame by Frame Iterative Touch!</title><link>https://foojayio.github.io/website/today/asyncgetcalltrace-reworked-frame-by-frame-with-an-iterative-touch/</link><pubDate>Thu, 10 Aug 2023 09:43:33 +0000</pubDate><guid>https://foojayio.github.io/website/today/asyncgetcalltrace-reworked-frame-by-frame-with-an-iterative-touch/</guid><description>&lt;p&gt;&lt;strong&gt;AsyncGetCallTrace is an API to obtain the top &lt;code&gt;n&lt;/code&gt; Java frames of a thread asynchronously in a signal handler.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This API is widely used but has its problems, see JEP 435 &lt;a href="https://foojayio.github.io/website/today/author/johannes-bechberger/"&gt;and my various articles on Foojay.io&lt;/a&gt;
.&lt;/p&gt;
&lt;p&gt;My original approach with my JEP proposal was to build a replacement of the API, which could be used as a drop-in for AsyncGetCallTrace. Still a single method that populates a preallocated frame list:&lt;br&gt;
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/08/asgct_asgst-2000x1125.png" alt="" loading="lazy"&gt;
&lt;/p&gt;</description></item><item><title>The Inner Workings of Safepoints</title><link>https://foojayio.github.io/website/today/the-inner-workings-of-safepoints/</link><pubDate>Wed, 02 Aug 2023 10:27:27 +0000</pubDate><guid>https://foojayio.github.io/website/today/the-inner-workings-of-safepoints/</guid><description>&lt;p&gt;A Java thread in the JVM regularly checks whether it should do extra work besides the execution of the bytecode.&lt;/p&gt;
&lt;p&gt;This work is done during so-called safepoints. There are two types of safepoints: local and global.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At thread-local safepoints, also known as thread-local handshakes, only the current thread does some work and is therefore blocked from executing the application.&lt;/li&gt;
&lt;li&gt;At global safepoints, all Java threads are blocked and do some work. At these safepoints, the state of the thread (thread-local safepoints) or the JVM (global safepoints) is fixed. This allows the JVM to do activities like method deoptimizations or stop-the-world garbage collections, where the amount of concurrency should be limited.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But this article isn&amp;rsquo;t about what (global) safepoints are. Fr this, please refer to Nitsan Wakart&amp;rsquo;s and Seetha Wenner&amp;rsquo;s articles on this topic and for thread-local safepoints, which are a relatively recent addition to JEP 312.&lt;/p&gt;</description></item><item><title>I could write a blog post, or ...</title><link>https://foojayio.github.io/website/today/i-could-write-a-blog-post-or/</link><pubDate>Sat, 15 Jul 2023 07:09:33 +0000</pubDate><guid>https://foojayio.github.io/website/today/i-could-write-a-blog-post-or/</guid><description>&lt;p&gt;My goal is to write a blog post every two weeks, it&amp;rsquo;s great to stick to a schedule and force yourself to publish pieces even if they are not perfect.&lt;/p&gt;
&lt;p&gt;This doesn&amp;rsquo;t mean that these blog posts are terrible, just that they could need a bit more polish or could cover a bit more of the topic. But I know many people that have dozens of half-finished blog posts in their pipeline, which aren&amp;rsquo;t just there and so they don&amp;rsquo;t publish anything for months.&lt;/p&gt;</description></item><item><title>Debugging OpenJDK Tests in VSCode (Without Losing Your Mind)</title><link>https://foojayio.github.io/website/today/debugging-openjdk-tests-in-vscode-without-losing-your-mind/</link><pubDate>Mon, 26 Jun 2023 11:27:55 +0000</pubDate><guid>https://foojayio.github.io/website/today/debugging-openjdk-tests-in-vscode-without-losing-your-mind/</guid><description>&lt;p&gt;Consider you want to debug a test case of the JDK like &lt;a href="https://github.com/openjdk/jdk/tree/master/test/hotspot/jtreg/serviceability/AsyncGetCallTrace" target="_blank" rel="noopener noreferrer"&gt;serviceability/AsyncGetCallTrace&lt;/a&gt;
. This test, and many others, are implemented using the &lt;em&gt;Regression Test Harness for the JDK&lt;/em&gt; (jtreg):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;jtreg&lt;/code&gt; is the test harness used by the JDK test framework. This framework is intended primarily for regression tests. It can also be used for unit tests, functional tests, and even simple product tests &amp;ndash; in other words, just about any type of test except a conformance test, which belong in a TCK.&lt;/p&gt;</description></item><item><title>Johannes Bechberger's Tour d'Europe</title><link>https://foojayio.github.io/website/today/report-of-my-small-tour-deurope/</link><pubDate>Fri, 16 Jun 2023 17:08:53 +0000</pubDate><guid>https://foojayio.github.io/website/today/report-of-my-small-tour-deurope/</guid><description>&lt;p&gt;Between 31st May and 14th June, I was on tour, giving seven talks in 4 cities in 3 different countries:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;31st May: &lt;a href="http://www.jugmilano.it/meeting-145.html" target="_blank" rel="noopener noreferrer"&gt;JUG Milano&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;5th June: &lt;a href="https://www.meetup.com/openvaluemuenchen/events/293736106/" target="_blank" rel="noopener noreferrer"&gt;OpenValue Munich Meetup&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;7th June: &lt;a href="https://jdriven.com/full-stack-conference-2023" target="_blank" rel="noopener noreferrer"&gt;JDriven Full Stack Conference in Nieuwegein&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;10th and 11th of June: &lt;a href="https://cfp.gulas.ch/gpn21/speaker/9ZMNT9/" target="_blank" rel="noopener noreferrer"&gt;Gulasch Programmier Nacht Karlsruhe&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;14th of June: &lt;a href="https://www.entwicklertag.de/2023/conference_day.html" target="_blank" rel="noopener noreferrer"&gt;Karlsruher Entwicklertag&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="wp-block-image size-full is-resized"&gt;
 &lt;img fetchpriority="high" decoding="async" src="https://mostlynerdless.de/wp-content/uploads/2023/06/image-7.png" alt="" class="wp-image-877" width="372" height="507"&gt;
 &lt;figcaption class="wp-element-caption"&gt;
 A visualization of all the cities I visited, but I took the train for all transits (except for the Arnhem to Nieuwegein route, where Ties van de Ven drove me in his Tesla).
 &lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;It was an exciting trip, and I had the pleasure of visiting friends in Zurich and Augsburg and a &lt;a href="https://www.muehlen-kaiser.de/" target="_blank" rel="noopener noreferrer"&gt;grain mill shop&lt;/a&gt;
 in Munich.&lt;/p&gt;</description></item><item><title>Class Loader Hierarchies</title><link>https://foojayio.github.io/website/today/class-loader-hierarchies/</link><pubDate>Sat, 03 Jun 2023 08:56:55 +0000</pubDate><guid>https://foojayio.github.io/website/today/class-loader-hierarchies/</guid><description>&lt;p&gt;Understanding class loader hierarchies is essential when developing Java agents, especially if these agents are instrumenting code.&lt;/p&gt;
&lt;p&gt;In my &lt;a href="https://foojayio.github.io/website/today/instrumenting-java-code-to-find-and-handle-unused-classes/"&gt;Instrumenting Java Code to Find and Handle Unused Classes&lt;/a&gt;
 article, I instrumented all classes with an agent and used a &lt;code&gt;Store&lt;/code&gt; class in this newly added code:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A challenge here is that all instrumented classes will use the Store. We, therefore, have to put the store onto the bootstrap classpath, making it visible to all classes.&lt;/p&gt;</description></item><item><title>Unlocking Reproducible Profiler Tests</title><link>https://foojayio.github.io/website/today/mastering-the-art-of-controlling-the-jit-unlocking-reproducible-profiler-tests/</link><pubDate>Fri, 19 May 2023 09:02:33 +0000</pubDate><guid>https://foojayio.github.io/website/today/mastering-the-art-of-controlling-the-jit-unlocking-reproducible-profiler-tests/</guid><description>&lt;p&gt;In my last article, &lt;a href="https://foojayio.github.io/website/today/using-async-profiler-and-jattach-programmatically-with-ap-loader/"&gt;Using Async-Profiler and Jattach Programmatically with AP-Loader&lt;/a&gt;
, I hinted that I&amp;rsquo;m currently working on a test library for writing better profiling API tests.&lt;/p&gt;
&lt;p&gt;The library is still work-in-progress, but it already allows you to write profiling API tests in plain Java:&lt;/p&gt;
&lt;pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""&gt;private int innerASGCT2() {
 new Tracer().runASGCT().assertTrue(
 Frame.hasMethod(0, "innerASGCT2", "()I"), 
 Frame.hasMethod(1, "testRunASGCT2"));
 return 0;
}

@Test
public void testRunASGCT2() {
 innerASGCT2();
}&lt;/pre&gt;
&lt;p&gt;This test case checks that calling AsyncGetCallTrace gives the correct result in this specific example. The test library allows you to write tests comparing the returns of multiple GetStackTrace, AsyncGetCallTrace, and AsyncGetStackTrace invocations in different modes and settings. The library can be found as trace-tester on GitHub; I aim to bring it into the OpenJDK later with my JEP.&lt;/p&gt;</description></item><item><title>Using Async-Profiler and Jattach Programmatically with AP-Loader</title><link>https://foojayio.github.io/website/today/using-async-profiler-and-jattach-programmatically-with-ap-loader/</link><pubDate>Thu, 04 May 2023 11:45:20 +0000</pubDate><guid>https://foojayio.github.io/website/today/using-async-profiler-and-jattach-programmatically-with-ap-loader/</guid><description>&lt;p&gt;Using &lt;a href="https://github.com/jvm-profiling-tools/async-profilerhttps://github.com/jvm-profiling-tools/async-profiler" target="_blank" rel="noopener noreferrer"&gt;async-profiler&lt;/a&gt;
 and jattach can be quite a hassle. First, you have to download the proper archive from GitHub for your OS and architecture; then, you have to unpack it and place it somewhere.&lt;/p&gt;
&lt;p&gt;It gets worse if you want to embed it into your library, agent, or application. Library developers cannot just use maven dependency but have to create wrapper code and build scripts that deal with packaging the binaries themselves, or worse, they depend on a preinstalled version which they do not control.&lt;/p&gt;</description></item><item><title>Couldn’t we just Use AsyncGetCallTrace in a Separate Thread?</title><link>https://foojayio.github.io/website/today/couldnt-we-just-use-asyncgetcalltrace-in-a-separate-thread/</link><pubDate>Tue, 25 Apr 2023 05:31:36 +0000</pubDate><guid>https://foojayio.github.io/website/today/couldnt-we-just-use-asyncgetcalltrace-in-a-separate-thread/</guid><description>&lt;p&gt;I&amp;rsquo;m keenly interested in everything related to profiling on the JVM, especially if it is related to AsyncGetCallTrace, this tiny unofficial API that powers most profilers out there, heck, I&amp;rsquo;m even in the process of adding an &lt;a href="https://mostlynerdless.de/blog/2023/01/19/asyncgetstacktrace-a-better-stack-trace-api-for-the-jvm/" target="_blank" rel="noopener noreferrer"&gt;improved version to the OpenJDK&lt;/a&gt;
, AsyncGetStackTrace.&lt;/p&gt;
&lt;p&gt;During the discussions on the related JDK enhancement proposal and PRs fixing AsyncGetCallTrace bugs, one thing often arises: Why is AsyncGetCallTrace always called in the signal handler on top of the stack that we want to walk (like in my &lt;a href="https://mostlynerdless.de/blog/tag/writing-a-profiler-from-scratch/" target="_blank" rel="noopener noreferrer"&gt;Writing a Profiler from Scratch&lt;/a&gt;
 series)?&lt;br&gt;
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/04/wall-clock-sampling-sequence.drawio-1.svg" alt="" loading="lazy"&gt;
 Interaction between the wall-clock sampler thread and the different signal handlers, as currently implemented in async-profiler.&lt;/p&gt;</description></item><item><title>Instrumenting Java Code to Find and Handle Unused Classes</title><link>https://foojayio.github.io/website/today/instrumenting-java-code-to-find-and-handle-unused-classes/</link><pubDate>Sat, 08 Apr 2023 13:26:34 +0000</pubDate><guid>https://foojayio.github.io/website/today/instrumenting-java-code-to-find-and-handle-unused-classes/</guid><description>&lt;p&gt;In this article, let&amp;rsquo;s take a look at writing a Java agent and instrumentation code to find unused classes and dependencies in your project.&lt;/p&gt;
&lt;p&gt;Knowing which classes and dependencies are not used in your application can save you from considering the bugs and problems in these dependencies and classes if you remove them.&lt;/p&gt;
&lt;p&gt;There a multiple tools out there, for gradle and maven (thanks, Marit), that do this statically or dynamically (like the one described in the paper Coverage-Based Debloating for Java Bytecode, thanks, Wolfram).&lt;/p&gt;</description></item><item><title>Writing a Profiler in 240 Lines of Pure Java</title><link>https://foojayio.github.io/website/today/writing-a-profiler-in-240-lines-of-pure-java/</link><pubDate>Thu, 30 Mar 2023 07:14:46 +0000</pubDate><guid>https://foojayio.github.io/website/today/writing-a-profiler-in-240-lines-of-pure-java/</guid><description>&lt;p&gt;A few months back, I started writing a profiler from scratch, and the code since became the base of my profiler validation tools.&lt;/p&gt;
&lt;p&gt;The only problem with this project: I wanted to write a proper non-safepoint-biased profiler from scratch.&lt;/p&gt;
&lt;p&gt;This is a noble effort, but it requires lots C/C++/Unix programming which is finicky, and not everyone can read C/C++ code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;For people unfamiliar with safepoint bias: A safepoint is a point in time where the JVM has a known defined state, and all threads have stopped. The JVM itself needs safepoints to do major garbage collections, Class definitions, method deoptimizations, and more. Threads are regularly checking whether they should get into a safepoint, for example, at method entry, exit, or loop backjumps. A profiler that only profiles at a safepoint have an inherent bias because it only includes frames from the locations inside methods where Threads check for a safepoint. The only advantage is that the stack-walking at safepoints is slightly less error-prone, as there are fewer mutations of heap and stack.&lt;/em&gt; &lt;em&gt;For more information, consider reading the excellent article &lt;a href="https://seethawenner.medium.com/java-safepoint-and-async-profiling-cdce0818cd29" target="_blank" rel="noopener noreferrer"&gt;Java Safepoint and Async Profiling&lt;/a&gt;
 by Seetha Wenner, the &lt;a href="http://Why%20JVM%20modern%20profilers%20are%20still%20safepoint%20biased?" target="_blank" rel="noopener noreferrer"&gt;more technical one by JP Bempel&lt;/a&gt;
, or the classic article &lt;a href="http://psy-lob-saw.blogspot.com/2015/12/safepoints.html" target="_blank" rel="noopener noreferrer"&gt;Safepoints: Meaning, Side Effects and Overheads&lt;/a&gt;
 by Nitsan Wakart. To conclude: Safepoint-biased profilers don&amp;rsquo;t give you a holistic view of your application, but can still be helpful to analyze major performance issues where you look at the bigger picture.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Book review - Practical Design Patterns for Java Developers</title><link>https://foojayio.github.io/website/today/book-review-practical-design-patterns-for-java-developers/</link><pubDate>Fri, 17 Mar 2023 08:27:08 +0000</pubDate><guid>https://foojayio.github.io/website/today/book-review-practical-design-patterns-for-java-developers/</guid><description>&lt;h2 id="h2-0-hone-your-software-design-skills-by-implementing-popular-design-patterns-in-java"&gt;Hone your software design skills by implementing popular design patterns in Java&lt;/h2&gt;
&lt;p&gt;This book is for sale on &lt;a href="https://www.amazon.de/dp/180461467X" target="_blank" rel="noopener noreferrer"&gt;Amazon in Kindle and Paperback editions&lt;/a&gt;
.&lt;/p&gt;
&lt;figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"&gt;
 &lt;figure class="wp-block-image size-large"&gt;
 &lt;img fetchpriority="high" decoding="async" width="830" height="1024" data-id="62853" src="practical-cover-830x1024.jpg" alt="" class="wp-image-62853"&gt;
 &lt;/figure&gt;
 &lt;figure class="wp-block-image size-large"&gt;
 &lt;img decoding="async" width="600" height="740" data-id="62852" src="practical-backside.jpg" alt="" class="wp-image-62852"&gt;
 &lt;/figure&gt;
 &lt;figure class="wp-block-image size-large"&gt;
 &lt;img decoding="async" width="426" height="426" data-id="62851" src="miro.jpg" alt="" class="wp-image-62851"&gt;
 &lt;/figure&gt;
&lt;/figure&gt;
&lt;p&gt;We&amp;rsquo;ll start this post with the personal verdict of two avid readers of this book:&lt;/p&gt;
&lt;h2 id="h2-1-frank-delporte-s-verdict"&gt;Frank Delporte&amp;rsquo;s Verdict&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve been programming since I was 10y old, but I graduated from film school as a video editor, so I never learned the &amp;ldquo;official&amp;rdquo; way to be a programmer. It was only by following courses and, most importantly, learning from colleagues that I started making &amp;ldquo;readable and maintainable&amp;rdquo; code, which is precisely the topic of this book.&lt;/p&gt;</description></item><item><title>Validating Java Profiling APIs</title><link>https://foojayio.github.io/website/today/validating-java-profiling-apis/</link><pubDate>Thu, 16 Mar 2023 14:43:48 +0000</pubDate><guid>https://foojayio.github.io/website/today/validating-java-profiling-apis/</guid><description>&lt;p&gt;In &lt;a href="https://foojayio.github.io/website/today/do-you-trust-profilers-i-once-did-too/"&gt;my last article&lt;/a&gt;
, I covered a correctness bug in the fundamental Java profiling API AsyncGetCallTrace that I found just by chance.&lt;/p&gt;
&lt;p&gt;Now the question is: could we find such bugs automatically?&lt;/p&gt;
&lt;p&gt;Potentially uncovering more bugs or being more confident in the absence of errors.&lt;/p&gt;
&lt;p&gt;I already wrote code to test the stability of the profiling APIs, testing for the lack of fatal errors, in my &lt;a href="https://github.com/parttimenerd/jdk-profiling-tester" target="_blank" rel="noopener noreferrer"&gt;jdk-profiling-tester&lt;/a&gt;
 project.&lt;/p&gt;
&lt;p&gt;Such tools are invaluable when modifying the API implementation or adding a new API.&lt;/p&gt;</description></item><item><title>Do you trust profilers? I once did too!</title><link>https://foojayio.github.io/website/today/do-you-trust-profilers-i-once-did-too/</link><pubDate>Wed, 01 Mar 2023 13:14:06 +0000</pubDate><guid>https://foojayio.github.io/website/today/do-you-trust-profilers-i-once-did-too/</guid><description>&lt;p&gt;Profilers are great tools in your toolbox, like debuggers, when solving problems with your Java application (I&amp;rsquo;ve been &lt;a href="https://foojayio.github.io/website/today/foojay-podcast-14/"&gt;on a podcast on this topic&lt;/a&gt;
 recently).&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll tell you some of their problems and a technique to cope with them in this article.&lt;/p&gt;
&lt;p&gt;There are many open-source profilers, most notably JFR/JMC, and async-profiler, that help you to find and fix performance problems.&lt;/p&gt;
&lt;p&gt;But they are just software themselves, interwoven with a reasonably large project, the OpenJDK (or OpenJ9, for that matter), and thus suffer from the same problems as the typical problems of the applications they are used to profile:&lt;/p&gt;</description></item><item><title>Foojay Podcast #14: Debugging Tools and Skills for Fun and Profit</title><link>https://foojayio.github.io/website/today/foojay-podcast-14/</link><pubDate>Mon, 20 Feb 2023 08:29:01 +0000</pubDate><guid>https://foojayio.github.io/website/today/foojay-podcast-14/</guid><description>&lt;p&gt;Let&amp;rsquo;s talk about debugging and observability.&lt;/p&gt;
&lt;p&gt;We work with debugging all the time, but how well do we know this common practice?&lt;/p&gt;
&lt;p&gt;Observability, monitoring, and debugging at scale for your production&amp;hellip;&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
			&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/ozcC3scY0Ig?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
		&lt;/div&gt;

&lt;h2 id="h2-1--odcast-pps"&gt;Podcast Apps&lt;/h2&gt;
&lt;p&gt;You can listen and subscribe to the Foojay Podcast on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://open.spotify.com/show/6CpTfgn9LirzJGAtc4ICdQ" target="_blank" rel="noopener noreferrer"&gt;Spotify&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://podcasts.apple.com/be/podcast/foojay-io-the-friends-of-openjdk/id1652281304" target="_blank" rel="noopener noreferrer"&gt;Apple Podcasts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;And most others&amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h2-1-guests"&gt;Guests&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A lot of rubber ducks&lt;/li&gt;
&lt;li&gt;Johannes Bechberger
&lt;ul&gt;
&lt;li&gt;JVM and profiler developer&lt;/li&gt;
&lt;li&gt;Worked on the JDWP protocol and profiling&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/parttimenerd" target="_blank" rel="noopener noreferrer"&gt;https://github.com/parttimenerd&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/parttimen3rd" target="_blank" rel="noopener noreferrer"&gt;https://twitter.com/parttimen3rd&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mastodon.social/@parttimenerd" target="_blank" rel="noopener noreferrer"&gt;https://mastodon.social/@parttimenerd&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mostlynerdless.de/blog/2023/01/19/asyncgetstacktrace-a-better-stack-trace-api-for-the-jvm/" target="_blank" rel="noopener noreferrer"&gt;AsyncGetStackTrace: A better Stack Trace API for the JVM&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mostlynerdless.de/blog/2022/12/27/a-short-primer-on-java-debugging-internals/" target="_blank" rel="noopener noreferrer"&gt;A short primer on Java debugging internals&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Marit van Dijk
&lt;ul&gt;
&lt;li&gt;Developer Advocate at JetBrains&lt;/li&gt;
&lt;li&gt;&lt;a href="https://maritvandijk.com/" target="_blank" rel="noopener noreferrer"&gt;https://maritvandijk.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/MaritvanDijk77" target="_blank" rel="noopener noreferrer"&gt;https://twitter.com/MaritvanDijk77&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mastodon.social/@maritvandijk" target="_blank" rel="noopener noreferrer"&gt;https://mastodon.social/@maritvandijk&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ties van de Ven
&lt;ul&gt;
&lt;li&gt;Software Engineer @ JDriven, Coach @ Jcore&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tiesvandeven.nl/" target="_blank" rel="noopener noreferrer"&gt;https://www.tiesvandeven.nl/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/ties_ven" target="_blank" rel="noopener noreferrer"&gt;https://twitter.com/ties_ven&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.jdriven.com/2017/10/6-steps-to-help-you-debug-your-application/" target="_blank" rel="noopener noreferrer"&gt;6 Steps to help you debug your application&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h2-2-host"&gt;Host&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Shai Almog
&lt;ul&gt;
&lt;li&gt;Author of &amp;ldquo;&lt;a href="https://www.amazon.com/dp/1484290410/" target="_blank" rel="noopener noreferrer"&gt;Practical Debugging at Scale&lt;/a&gt;
&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://debugagent.com/" target="_blank" rel="noopener noreferrer"&gt;https://debugagent.com/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mastodon.social/@debugagent" target="_blank" rel="noopener noreferrer"&gt;https://mastodon.social/@debugagent&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/debugagent" target="_blank" rel="noopener noreferrer"&gt;https://twitter.com/debugagent&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h2-3-producer"&gt;Producer&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Frank Delporte
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://foojay.social/@frankdelporte" target="_blank" rel="noopener noreferrer"&gt;https://foojay.social/@frankdelporte&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/frankdelporte" target="_blank" rel="noopener noreferrer"&gt;https://twitter.com/frankdelporte&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h2-4-content"&gt;Content&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;00'00 Intro and music&lt;/li&gt;
&lt;li&gt;00'24 About the topic of this podcast&lt;/li&gt;
&lt;li&gt;00'58 Introduction of the guests and host&lt;/li&gt;
&lt;li&gt;05'14 Debugging with IntelliJ IDEA and discoverability of tools
&lt;ul&gt;
&lt;li&gt;YouTube: &lt;a href="https://www.youtube.com/watch?v=59RC8gVPlvk&amp;amp;list=PLPZy-hmwOdEUWF85MuwrKV8YVWLmZW4ZA" target="_blank" rel="noopener noreferrer"&gt;Debugger playlist&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;YouTube: &lt;a href="https://www.youtube.com/watch?v=OQcyAtukps4" target="_blank" rel="noopener noreferrer"&gt;Profiling tools&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;YouTube: &lt;a href="https://www.youtube.com/watch?v=TDpbt4thECc" target="_blank" rel="noopener noreferrer"&gt;Profiling live stream&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;13'27 JDWP protocol
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dzone.com/articles/remote-debugging-java-applications-with-jdwp" target="_blank" rel="noopener noreferrer"&gt;DZone: Remote Debugging Java Applications With JDWP&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://foojayio.github.io/website/today/psa-the-risks-of-remote-jdwp-debugging/"&gt;Foojay: PSA: The Risks of Remote JDWP Debugging&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://foojayio.github.io/website/today/a-short-primer-on-java-debugging-internals/"&gt;Foojay: A Short Primer on Java Debugging Internals&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;19'43 Exception breakpoints
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://foojayio.github.io/website/today/exception-breakpoint-that-doesnt-suck-and-a-real-use-case-for-method-breakpoints/"&gt;Foojay: Exception Breakpoint that Doesn&amp;rsquo;t Suck and a Real Use Case for Method Breakpoints&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;20'34 External debugging tools
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://rubberduckdebugging.com/" target="_blank" rel="noopener noreferrer"&gt;https://rubberduckdebugging.com/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;26'55 Observability
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://istio.io/latest/about/service-mesh/" target="_blank" rel="noopener noreferrer"&gt;https://istio.io/latest/about/service-mesh/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.redhat.com/en/topics/microservices/what-is-a-service-mesh" target="_blank" rel="noopener noreferrer"&gt;https://www.redhat.com/en/topics/microservices/what-is-a-service-mesh&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://openjdk.org/jeps/435" target="_blank" rel="noopener noreferrer"&gt;https://openjdk.org/jeps/435&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;37'58 What information should you look for while debugging&lt;/li&gt;
&lt;li&gt;45'46 Be aware of tunnel vision while debugging&lt;/li&gt;
&lt;li&gt;49'33 What to do if you don&amp;rsquo;t know where to search for the bug
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/docs/git-bisect" target="_blank" rel="noopener noreferrer"&gt;https://git-scm.com/docs/git-bisect&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://foojayio.github.io/website/today/understand-the-root-cause-of-regressions-with-git-bisect/"&gt;Foojay: External Debugging Tools 2: git bisect&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;57'05 Outro&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>JFR Timestamps and System.nanoTime Foojay.io</title><link>https://foojayio.github.io/website/today/jfr-timestamps-and-system-nanotime/</link><pubDate>Wed, 08 Feb 2023 15:33:34 +0000</pubDate><guid>https://foojayio.github.io/website/today/jfr-timestamps-and-system-nanotime/</guid><description>&lt;p&gt;Did you ever wonder whether JFR timestamps use the same time source as &lt;code&gt;System.nanoTime&lt;/code&gt;?&lt;/p&gt;
&lt;p&gt;This is important when you have miscellaneous logging besides JFR events; otherwise, you would not be able to match JFR events and your logging properly.&lt;/p&gt;
&lt;p&gt;We assume here that you use &lt;code&gt;System.nanoTime&lt;/code&gt; and not less-suited timing information from &lt;code&gt;System.currentTimeMillis&lt;/code&gt;&lt;strong&gt;()&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The journey into this started with a question on the JDK Mission Control slack channel, which led me into a rabbit hole:&lt;/p&gt;</description></item><item><title>Using Firefox Profiler beyond the web</title><link>https://foojayio.github.io/website/today/using-firefox-profiler-beyond-the-web/</link><pubDate>Fri, 03 Feb 2023 15:28:55 +0000</pubDate><guid>https://foojayio.github.io/website/today/using-firefox-profiler-beyond-the-web/</guid><description>&lt;p&gt;&lt;em&gt;This blog post is the base for the second half of my upcoming talk at FOSDEM 2023 on the topic &amp;ldquo;&lt;a href="http://%22https://fosdem.org/2023/schedule/event/mozilla_firefox_profiler_beyond_the_web/" target="_blank" rel="noopener noreferrer"&gt;Firefox Profiler beyond the web: Using Firefox Profiler to view Java profiling data&lt;/a&gt;
.&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I detailed in &lt;a href="https://mostlynerdless.de/?p=628" target="_blank" rel="noopener noreferrer"&gt;my last blog post&lt;/a&gt;
 how the Firefox Profiler can be used to view Java profiling data:
&lt;img src="https://mostlynerdless.de/wp-content/uploads/2023/01/Screenshot-2023-01-27-at-12.34.45-1-2000x1201.png" alt="" loading="lazy"&gt;
&lt;/p&gt;
&lt;p&gt;But I&amp;rsquo;m of course not the only one who uses Firefox Profiler beyond the web because using it has many advantages: You&amp;rsquo;re essentially getting a prototypical visualization for your data in an afternoon.&lt;/p&gt;</description></item><item><title>Firefox Profiler Beyond the Web: IntelliJ plugin for JFR</title><link>https://foojayio.github.io/website/today/firefox-profiler-beyond-the-web/</link><pubDate>Thu, 02 Feb 2023 13:13:17 +0000</pubDate><guid>https://foojayio.github.io/website/today/firefox-profiler-beyond-the-web/</guid><description>&lt;p&gt;&lt;em&gt;This blog post is the base of the first half of my upcoming talk at FOSDEM 2023 on the topic &amp;ldquo;&lt;a href="https://fosdem.org/2023/schedule/event/mozilla_firefox_profiler_beyond_the_web/" target="_blank" rel="noopener noreferrer"&gt;Firefox Profiler beyond the web: Using Firefox Profiler to view Java profiling data&lt;/a&gt;
.&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;For the impatient:&lt;/strong&gt; Take a look at my &lt;a href="https://plugins.jetbrains.com/plugin/20937-java-jfr-profiler" target="_blank" rel="noopener noreferrer"&gt;Java JFR Profiler&lt;/a&gt;
 IntelliJ plugin to easily profile your application and view JFR files directly in your IDE.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I got involved in the &lt;a href="https://profiler.firefox.com/" target="_blank" rel="noopener noreferrer"&gt;Firefox Profiler&lt;/a&gt;
 development, spending significant portions of my time at SAP in the last half year on it. It has been an exciting ride. I learned a lot and contributed a few features. So I was essentially developing React code when I wasn&amp;rsquo;t working on ASGST or other OpenJDK-related tools.&lt;/p&gt;</description></item><item><title>AsyncGetStackTrace: A better Stack Trace API for the JVM</title><link>https://foojayio.github.io/website/today/asyncgetstacktrace-a-better-stack-trace-api-for-the-jvm/</link><pubDate>Thu, 26 Jan 2023 09:16:06 +0000</pubDate><guid>https://foojayio.github.io/website/today/asyncgetstacktrace-a-better-stack-trace-api-for-the-jvm/</guid><description>&lt;p&gt;&lt;em&gt;This article is the basis for my upcoming talk at&lt;/em&gt; &lt;a href="https://fosdem.org/2023/schedule/event/asyncgetstacktrace_the_improved_version_of_asyncgetcalltrace_jep_435/" target="_blank" rel="noopener noreferrer"&gt;&lt;em&gt;FOSDEM 2023,&lt;/em&gt;&lt;/a&gt;
&lt;em&gt;&amp;ldquo;AsyncGetStackTrace: The Improved Version Of AsyncGetCallTrace (JEP 435),&lt;a href="https://fosdem.org/2023/schedule/event/asyncgetstacktrace_the_improved_version_of_asyncgetcalltrace_jep_435/" target="_blank" rel="noopener noreferrer"&gt;&amp;rdquo;&lt;/a&gt;
 and is based on JEP Candidate 435.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Consider you want to write a profiler to profile Java applications. Why? Because you think that the existing ones &lt;a href="http://psy-lob-saw.blogspot.com/2016/02/why-most-sampling-java-profilers-are.html" target="_blank" rel="noopener noreferrer"&gt;&amp;quot;[&amp;hellip;] Are Fucking Terrible&amp;quot;&lt;/a&gt;
 or &lt;a href="https://youtu.be/7IkHIqPeFjY?list=PLLLT4NxU7U1QYiqanOw48h0VUjlUvqCCv&amp;amp;t=919" target="_blank" rel="noopener noreferrer"&gt;&amp;quot;[&amp;hellip;] Broken&amp;quot;&lt;/a&gt;
. &lt;em&gt;Or you want to start a &lt;a href="https://mostlynerdless.de/blog/tag/writing-a-profiler-from-scratch/" target="_blank" rel="noopener noreferrer"&gt;blog series&lt;/a&gt;
&lt;/em&gt; on writing a profiler from scratch to learn their inner workings (hi there,**regular readers)&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Writing a Profiler from Scratch: The Profiling Loop</title><link>https://foojayio.github.io/website/today/writing-a-profiler-from-scratch-the-profiling-loop/</link><pubDate>Thu, 12 Jan 2023 15:26:34 +0000</pubDate><guid>https://foojayio.github.io/website/today/writing-a-profiler-from-scratch-the-profiling-loop/</guid><description>&lt;br /&gt;
&lt;blockquote&gt;
&lt;p&gt;This is the second post in the series, building a profiler from scratch using AsyncGetCallTrace. Today, we&amp;rsquo;re covering wall-clock profiling and how to collect the obtain stack traces. If you&amp;rsquo;re unfamiliar with AsyncGetCallTrace, please check out my previous article in the series &lt;a href="https://foojayio.github.io/website/today/writing-a-profiler-from-scratch-introduction/"&gt;here&lt;/a&gt;
.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Our goal today is to essentially write the primary loop of a profiler and do the following every n milliseconds (where n is our chosen profiling interval):
&lt;img src="https://foojayio.github.io/website/today/writing-a-profiler-from-scratch-the-profiling-loop/diagrams3-2048x1029-1-1024x515.png" alt="" loading="lazy"&gt;
&lt;/p&gt;</description></item><item><title>A Short Primer on Java Debugging Internals</title><link>https://foojayio.github.io/website/today/a-short-primer-on-java-debugging-internals/</link><pubDate>Mon, 02 Jan 2023 08:14:17 +0000</pubDate><guid>https://foojayio.github.io/website/today/a-short-primer-on-java-debugging-internals/</guid><description>&lt;p&gt;I wanted to write about a small side project&amp;mdash;a few months back, I got carried away with understanding how Java debugging works.&lt;/p&gt;
&lt;p&gt;The following is an hors d&amp;rsquo;oeuvre, a small post in between my series on profiling, on the &lt;a href="https://docs.oracle.com/en/java/javase/17/docs/specs/jpda/jpda.html" target="_blank" rel="noopener noreferrer"&gt;Java Platform Debugging Architecture&lt;/a&gt;
.&lt;/p&gt;
&lt;p&gt;All Java debuggers use the &lt;a href="https://docs.oracle.com/en/java/javase/17/docs/specs/jdwp/jdwp-spec.html" title="Java Debug Wire Protocol (JDWP)" target="_blank" rel="noopener noreferrer"&gt;Java Debug Wire Protocol (JDWP)&lt;/a&gt;
 to communicate with the JVM, usually using the Java Debug Interface (JDI) abstraction Layer. The protocol can be used to remote debug, but the JVM and the debugger are commonly on the same machine.&lt;/p&gt;</description></item><item><title>Writing a Profiler from Scratch: Introduction</title><link>https://foojayio.github.io/website/today/writing-a-profiler-from-scratch-introduction/</link><pubDate>Wed, 21 Dec 2022 15:26:44 +0000</pubDate><guid>https://foojayio.github.io/website/today/writing-a-profiler-from-scratch-introduction/</guid><description>&lt;p&gt;&lt;a href="https://github.com/jvm-profiling-tools/async-profiler" target="_blank" rel="noopener noreferrer"&gt;Async-profiler&lt;/a&gt;
 is undoubtedly one of the most used open-source Java profilers out there.&lt;/p&gt;
&lt;p&gt;Its most commonly used feature is sampling a given Java program&amp;rsquo;s stack traces and visualizing them as a flame graph. I would recommend reading the excellent &lt;a href="https://krzysztofslusarski.github.io/2022/12/12/async-manual.html" target="_blank" rel="noopener noreferrer"&gt;async-profiler manual&lt;/a&gt;
 by Krzysztof Ślusarski or taking a look at my profiling playlist on YouTube if you&amp;rsquo;re new to this tool.&lt;/p&gt;
&lt;p&gt;After using the async-profiler for a while, you might wonder: How does this tool work? And, of course, if you&amp;rsquo;re someone like me: Could I write a stripped-down versionto learn how it really works?&lt;/p&gt;</description></item><item><title>JFR Event Collection</title><link>https://foojayio.github.io/website/today/jfr-event-collection/</link><pubDate>Thu, 08 Dec 2022 10:08:52 +0000</pubDate><guid>https://foojayio.github.io/website/today/jfr-event-collection/</guid><description>&lt;p&gt;Ever wondered what all the JDK Flight Recorder events are, in which JDK versions they are supported, and what examples of an event looks like?&lt;/p&gt;
&lt;p&gt;Wonder no more, I created the &lt;a href="https://sapmachine.io/jfrevents" target="_blank" rel="noopener noreferrer"&gt;JFR Event Collection&lt;/a&gt;
 website which contains all this and more.
&lt;a href="https://sapmachine.io/jfrevents" target="_blank" rel="noopener noreferrer"&gt;&lt;img src="https://foojayio.github.io/website/today/jfr-event-collection/Screenshot-2022-12-05-at-18.01.21-1024x574.png" alt="Screenshot of https://sapmachine.io/jfrevents" loading="lazy"&gt;
&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;This site gives you an up-to-date collection of all OpenJDK JFR events for every JDK since 11, giving you the following additional information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;configuration properties&lt;/li&gt;
&lt;li&gt;fields with their types and description&lt;/li&gt;
&lt;li&gt;examples from a renaissance benchmark run&lt;/li&gt;
&lt;li&gt;with which GC this event appears&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/parttimenerd/jfreventcollector/blob/main/additional.xml" target="_blank" rel="noopener noreferrer"&gt;additional descriptions&lt;/a&gt;
 collected by JFR users&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The idea for this website came during the development of my prototypical JFR UI:
&lt;img src="https://foojayio.github.io/website/today/jfr-event-collection/Screenshot-of-JFR-events-viewer-1024x447.png" alt="Screenshot of JFR events viewer" loading="lazy"&gt;
&lt;/p&gt;</description></item><item><title>AP-Loader: A New Way to Use and Embed async-profiler</title><link>https://foojayio.github.io/website/today/ap-loader-a-new-way-to-use-and-embed-async-profiler/</link><pubDate>Tue, 22 Nov 2022 14:54:35 +0000</pubDate><guid>https://foojayio.github.io/website/today/ap-loader-a-new-way-to-use-and-embed-async-profiler/</guid><description>&lt;p&gt;Using &lt;a href="https://github.com/jvm-profiling-tools/async-profiler" target="_blank" rel="noopener noreferrer"&gt;async-profiler&lt;/a&gt;
 can be quite a hassle.&lt;/p&gt;
&lt;p&gt;First, you have to download the right archive from &lt;a href="https://github.com/jvm-profiling-tools/async-profiler/releases/tag/v2.8.3" title="GitHub" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
 for your OS and architecture, then you have to unpack it and place it somewhere.&lt;/p&gt;
&lt;p&gt;Or you get it from your OS distribution, hoping that it is the current version.&lt;/p&gt;
&lt;p&gt;It gets worse if you want to embed it into your library, agent, or application. Library developers cannot just use a Maven dependency but have to create wrapper code and build scripts that deal with packaging the binaries themselves. Or, worse, they depend on a preinstalled version which they do not control.&lt;/p&gt;</description></item><item><title>Java Profiling Overview</title><link>https://foojayio.github.io/website/today/java-profiling-overview/</link><pubDate>Mon, 14 Nov 2022 09:14:25 +0000</pubDate><guid>https://foojayio.github.io/website/today/java-profiling-overview/</guid><description>&lt;p&gt;When I ask Java developers whether they do profile, the answer is usually &amp;ldquo;no&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;The few that profiled before usually used VisualVM as a student and maybe JProfiler or YourKit years ago at work.&lt;/p&gt;
&lt;p&gt;One of the reasons for this is a lack of available information and thus knowledge for everyday Java developers.&lt;/p&gt;
&lt;p&gt;This is a pity as profiling should be a part of the tool belt for every experienced developer (not just for Java). The problem is that most of the open-source profilers are targeted to the OpenJDK developers (or their colleagues), even if they won&amp;rsquo;t admit it. This can be seen in the lack of entry-level material on this topic and even the little that is out there is distributed across multiple conference websites, blogs, YouTube channels, and Twitter accounts.&lt;/p&gt;</description></item></channel></rss>