CheckOps home

Tools directory

J

CheckOps

JMH

JMH (Java Microbenchmark Harness) is OpenJDK's GPL-2.0 harness for building, running and analysing nano, micro, milli and macro benchmarks in Java and other JVM languages.

Visit website

Latest public signals

Last updated: 11 November 2026 (page expanded from the official README or site).

Visit Website

Introduction

JMH is a Java harness for building, running and analysing nano/micro/milli/macro benchmarks written in Java and other JVM languages. It is part of OpenJDK’s code tools. The README recommends a standalone Maven project that depends on your application’s jars so benchmarks initialise correctly.

The source code is at openjdk/jmh on GitHub under the GPL-2.0 licence, with about 2,700 stars; the most recent commit was on 14 July 2026.

JMH (Java Microbenchmark Harness) is the OpenJDK project for building, running and analysing nano, micro, milli and macro benchmarks for Java and other JVM languages. It handles JIT warm-up, dead-code elimination, forking and statistical reporting, problems that make hand-written timing loops unreliable. The README recommends a standalone Maven project that depends on your application’s jars to get reliable results.

Where it fits: on CheckOps, JMH is listed alongside alternatives such as BenchmarkDotNet, hyperfine, Gatling and JMeter. When comparing them, check licence and hosting model, how results reach developers (pull requests, CI logs or dashboards), how much tuning is needed to keep noise low, and whether the project or vendor is actively maintained.

Features

  1. Annotations: @Benchmark, @State, @Warmup and more.
  2. JIT-aware: Handles warm-up and dead-code elimination pitfalls.
  3. Modes: Throughput, average time, sample time and single-shot.
  4. Profilers: Built-in profiler integrations.
  5. Maven archetype: Quick project setup.

Pros

  1. Free to use: Open source under GPL-2.0.
  2. Maintained: Commits as recent as 14 July 2026.

Cons

  1. Micro only: Not for system load.
  2. Expertise needed: Correct benchmarks still require care.
mvn archetype:generate -DarchetypeGroupId=org.openjdk.jmh -DarchetypeArtifactId=jmh-java-benchmark-archetype
mvn clean verify && java -jar target/benchmarks.jar

Resources:

Getting started tips: run JMH against a production-like test environment, never an unprepared shared system, and agree the target throughput and latency thresholds before the test. Start with a short smoke test, increase load gradually, watch server-side metrics alongside the tool’s client-side numbers, and keep test scripts in version control so results can be repeated and compared between releases.

Pricing

JMH is free and open source under the GPL-2.0 licence.

  1. JVM developers measuring hot code paths.
  2. Library maintainers guarding performance.
  3. Not a fit for load testing services.

Conclusion

JMH is the standard micro-benchmark harness for the JVM.

As with any tool in this category, the value of JMH comes from running it consistently and acting on what it finds, so wire it into an existing workflow rather than treating it as an occasional audit.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with JMH side by side.