The JVM hub · Java · Kotlin
Articles on the JVM
Profiling, memory and garbage collection, runtime and production, Java and Kotlin architecture. Written from real problems seen in production.
All articles
Compact object headers: what the flag saves on JDK 25 A program that keeps a HashMap of five million entries has 487 MB of live heap. JDK 25 offers a flag that shrinks the object header from 12 to 8 bytes. We measure what each object type really saves, and why some save nothing. Memory and garbage collector jcmd: the commands to know in production A service is slow, no profiler is installed, and all we have is a shell in the container. The JDK already ships jcmd. This article shows the commands that help on call, with their real output and the pause they impose on the application. Profiling and performance Kotlin value classes: when the abstraction is not free Two million instances of a value class in a heap histogram. It is not supposed to have instances at runtime. This article shows where the Kotlin compiler boxes it, and what it costs. Memory and garbage collector JDK Flight Recorder in production: record, read, automate JFR is part of the JDK. It records GCs, locks, exceptions and I/O, at a low cost. Everything can be read from the command line, with no GUI. Profiling and performance The modular monolith with Gradle and Spring Modulith A monolith is not a problem. A monolith where everything imports everything is. You can draw real boundaries inside a single deployable, and have the build check them. Architecture and design The 6 JVM OutOfMemoryErrors and how to read each one An OutOfMemoryError is not one problem. The text after the colon names a specific memory area, a different cause and a different tool. All six messages, reproduced one by one. Memory and garbage collector Kotlin coroutines in production: dispatchers and leaks A coroutine is not a thread. That is what makes it cheap, and also what lets a blocking call, an overly broad catch or a thread dump lie to you without warning. Everything verified on kotlinx-coroutines 1.11 and JDK 25. Runtime and production Off-heap memory: where the JVM's RAM goes The container's RSS keeps climbing, the heap looks fine, and the pod ends up OOMKilled. The memory went off-heap. Where to look, and how to measure it with Native Memory Tracking. Memory and garbage collector Testing architecture with ArchUnit and Konsist An architecture rule nobody checks does not survive six months of sprints. It only holds if it breaks the build, like any other test. Architecture and design Reading GC logs without external tools A gc.log file can be read by hand. Once you can decode the summary line and the region-by-region breakdown, you can spot a problem before opening any profiler. Memory and garbage collector Virtual threads in production: what actually breaks Since JDK 24, synchronized no longer pins the carrier thread. Most articles online still tell you to avoid it. What actually breaks in production is somewhere else. Runtime and production Tuning the JVM in a container An app that runs fine locally but gets killed on Kubernetes is almost always a story of misread cgroup limits and a badly sized heap. What to tune, and why. Runtime and production Diagnosing a memory leak with a heap dump When memory climbs and never comes back down, the heap dump holds every object in the heap. The job is to find which one keeps all the memory, and why the GC can't free it. Memory and garbage collector Reading a thread dump with jstack The JDK tool that photographs the state of every thread in a live JVM. Enough to see in seconds who is stuck, on what, and why. Profiling and performance Tuning the JVM garbage collector GC tuning starts with deciding what you optimise and reading the logs, not with copying flags from a forum. A tour of the levers that actually matter. Memory and garbage collector Micronaut observability: metrics, traces and context Wiring Micrometer, OpenTelemetry and structured logs into Micronaut, plus the one thing that quietly breaks everything: losing the propagated context when you hand work to another thread. Runtime and production Hexagonal architecture in Spring Boot: ports and adapters Ports & adapters, concretely: a domain with no Spring annotations, ports as interfaces, and Spring demoted to an adapter. With the package layout. Architecture and design How to read a flamegraph Width = time, height = stack depth, and above all: the horizontal axis is not time. The reading rules, then six real graphs explained. Profiling and performance Profiling the JVM with async-profiler A sampling profiler that doesn't lie about safepoints, runs in production with minimal overhead, and outputs a flamegraph directly. Hands-on with a real case, before and after the fix. Profiling and performance
No article matches.
Why this site
Information about the JVM is scattered: a blog post, a Stack Overflow answer, a GC flag in old documentation. This site puts it in one place.
Each article starts from a specific problem: latency going up, a memory leak, a flamegraph that is hard to read. It explains what to look at, with which tools, and how to read the result.