Taming the Bias: Unbiased Safepoint-Based Stack Walking

Walking only at safepoints has advantages. The main one is that you aren’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 the new Java feature that cannot support using signal-handler-based APIs like AsyncGetCallTrace. …

Read More »

Thread-Safe Counter in Java: A Comprehensive Guide

In this tutorial, we will explore the concept of thread safety in Java, specifically focusing on a simple counter. We will start by understanding why a basic counter is not safe for multiple threads; then, we will progressively enhance its thread safety using different techniques such as synchronization, locks, Unsafe, VarHandle, and finally, AtomicInteger. We will be referencing the code …

Read More »

6 Considerations when Building High-Performance Java Microservices with EDA

Event-Driven Architecture (EDA) is a design principle focused on the creation, detection, and reaction to events. Renowned for its resilience and low latency, EDA is a reliable choice for developing robust, high-performing microservices. Moreover, this method can be helpful in improving productivity and making the process of cloud migration smoother. In this article we will outline 6 key considerations and …

Read More »

Pitest: Do You Test Your Tests?

What is Pitest? Pitest is a library that helps us do mutation testing. Mutation testing is a process in which random variations of the code under test are generated. Hence, our tests will run against variants of the code that we’re intending to test. If the test fails, the mutation is killed, if it still passes it lives. So in …

Read More »

My Final Take on Gradle (vs. Maven)

I tweet technical content that I consider interesting, but the funny tweets are the ones that get the most engagement. I attended the JavaLand conference in March, stumbled upon the Gradle booth, and found this gem: Of course, at some point, a fanboy hijacked the thread and claimed the so-called superiority of Gradle. In this post, I’d like to shed …

Read More »

Can’t Reproduce a Bug?

The phrase “it works on my machine” can be a source of amusement, but it also represents a prevailing attitude in the world of development – an attitude that often forces users to prove bugs before we’re willing to investigate them. But in reality, we need to take responsibility and chase the issue, regardless of where it takes us. A …

Read More »

Pi4J Operating System for Java development on Raspberry Pi

Yes, the Raspberry Pi Operating System is awesome! But the Pi4J project made it even more awesome by adding “goodies” for Java developers! Pi4J OS is not yet another OS, but the official Raspberry Pi OS, with additional tools and preconfigurations to make it the ideal OS for any Java and JavaFX developer who wants to use a Raspberry Pi. …

Read More »

AsyncGetCallTrace Reworked: Frame by Frame with an Iterative Touch!

AsyncGetCallTrace is an API to obtain the top n Java frames of a thread asynchronously in a signal handler. This API is widely used but has its problems, see JEP 435 and my various articles on Foojay.io. My original approach with my JEP proposal was to build a replacement of the API, which could be used as a drop-in for …

Read More »

Working with GitLab Merge Requests in IntelliJ IDEA

In this tutorial, we will take a look at working with GitLab Merge Requests inside IntelliJ IDEA. When reviewing Merge Requests in a web interface, we don’t have the same support that our IDE gives us, like syntax highlighting and the context within which the code was written. IntelliJ IDEA has support for reviewing and merging GitLab Merge Requests. These …

Read More »

Observing Java Applications Running via Docker Compose Using OpenTelemetry

An easy non-obtrusive way to collect data about your dockerized app without changing your existing docker-compose.yml or docker files! This is just a neat trick that I discovered when I was trying to collect OTEL data about my application which was running via Docker Compose. I was trying to understand more about the code using tracing. However, I definitely didn’t want to modify …

Read More »