Topic archive
Java
Java tutorials, examples, and performance tips.
-
JDK 27 Turns On Compact Object Headers: Which Objects Shrink and Which Do Not
Measured on JDK 25 and 27 with a synthetic heap: small objects lose 8 bytes each, Integer loses nothing, and a String saves 8 bytes or nothing depending on its length. JDK 25 gets the same layout with one flag. A second default change in JDK 27 picks G1 where older JDKs picked Serial.
-
Diagnosing and Mitigating CPU Spikes Caused by Biased Locking in Java Applications
Explore strategies to identify and resolve CPU spikes due to biased locking in Java, enhancing application concurrency and JVM tuning.

-
Diagnosing and Mitigating Memory Leaks Caused by ThreadLocal Misuse in Java Applications
Explore techniques to detect and fix memory leaks from ThreadLocal misuse in Java, ensuring efficient resource management in multithreaded environments.

-
Tradeoffs and Performance Implications of Different Java Serialization Frameworks in Microservices
Analyze key tradeoffs and performance impacts of Java serialization frameworks to guide microservice integration choices.

-
Implementing and Tuning Bounded Queues for Backpressure Control in Java ExecutorServices
Explore techniques to apply backpressure in Java ExecutorServices using bounded queues and rejection policies for stable, efficient concurrent processing.

-
Detecting and Preventing Thread Starvation in Java ExecutorServices
Explore techniques to identify and mitigate thread starvation in Java ExecutorServices for improved concurrency and application performance.

-
JSON to Java, Kotlin and TypeScript in the Browser: What JSON2Class Infers and Where It Stops
A walk through the type inference behind JSON2Class, a browser-only JSON to class generator I build and maintain: the Java, Kotlin and TypeScript it emits for one order payload, the annotation directives you can write inside the JSON, how array element types widen across every element, and the limits that remain before you paste production…
-
Async Logging with the LMAX Disruptor in Java: What Blocks, What Drops, and What You Lose
A tested Disruptor 4.0.0 async logger: why ringBuffer.next() blocks when the buffer is full, how tryNext() drops, two ways to lose log lines silently, and a benchmark with stated boundaries.
