
How to Write a Correct Microbenchmark With JMH in Java
Write a correct Java microbenchmark with JMH: project setup, state classes, Blackhole, warmup, forks, avoiding dead code elimination and reading the results.
Everything you need to level up your coding skills.

Write a correct Java microbenchmark with JMH: project setup, state classes, Blackhole, warmup, forks, avoiding dead code elimination and reading the results.

Use Hibernate StatelessSession to import and export large data sets without a persistence context, with JDBC batching, scrollable queries and the trade-offs.

What the Java Memory Model guarantees about visibility and ordering, how happens-before edges are created and why unsynchronized code can loop forever.

Map every region of memory a JVM process uses, from the heap and thread stacks to Metaspace and direct buffers, and measure each with Native Memory Tracking.

Fix a Java container killed with OOMKilled and exit code 137 by budgeting heap, metaspace, threads and native memory inside the container limit.

Shrink a Java Docker image in six steps: drop the JDK, build in a stage, layer the Spring Boot jar, choose the base, trim dependencies and run non-root.

Why HikariCP reports that a connection is not available, how to tell a leak from a pool that is too small, and how to size the pool for the database.

Recognize a Java deadlock in a thread dump, find the two locks and threads involved, and remove the cycle with lock ordering, timeouts or smaller locks.

Understand JIT tiered compilation: the interpreter, C1 and C2 tiers, profiling, inlining, deoptimization, warm up and the flags that matter.

Understand JSF view state: server side versus client side saving, session memory per view, the number of views setting and how to keep it small.

Fix RejectedExecutionException by telling a full queue from a shut down executor and choosing a pool size, queue bound and rejection policy on purpose.

Cut Testcontainers overhead: static containers, the singleton pattern, Spring context caching, local reuse and cleaning state between tests.
We send one email when a new post is published. No spam.