Library / SDK
aeron-io/agrona avatar
aeron-io/agrona

Agrona: high-performance Java data structures behind Aeron

High Performance data structures and utility methods for Java

3,255 stars454 forksJavaApache-2.0

At a glance

What is it?
Agrona is a Java library of off-heap buffers, primitive collections, lock-less queues and a timer wheel, maintained by the Aeron project. It is built for low-latency systems work, not for general application code, and its documentation lives mostly in Javadoc rather than the README.
Who is it for?
Adopt Agrona if you are building low-latency Java infrastructure and already accept off-heap memory, manual buffer lifetimes and primitive-specialised collections; the library is published on Maven Central and the last push to the repository was on 2026-09-23. Do not adopt it as a general-purpose collections replacement, because its maps, sets and lists exist to avoid boxing and allocation in specific shapes, and the README does not present it as a drop-in substitute.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Agrona is for, and who actually needs it

Agrona is a library of data structures and utility methods for Java programs where allocation and cache behaviour matter. The README frames it as the common needs of high-performance applications, and says many of the utilities are used inside Aeron, the reliable UDP and IPC message transport, and that Agrona supplies high-performance buffer implementations for the Simple Binary Encoding codec. That origin explains the shape of the library: it is not a general collection framework but a set of pieces that a messaging system needed.

The intended user is someone writing latency-sensitive Java: a market data handler, a transport, a trading or telemetry service. If your application spends its time in a web framework or a database driver, the specific classes here (off-heap ring buffers, primitive-keyed open addressing maps, an agent framework for concurrent services) solve problems you probably do not have. The cost of adopting Agrona is not the dependency, it is the programming model: you take responsibility for memory that lives outside the heap and for the lifetimes of the objects that wrap it.

The mechanism: off-heap buffers, primitive keys, lock-less queues

The README lists the utility groups plainly, and the grouping is the architecture. Buffers are thread-safe direct and atomic buffers for on-heap and off-heap memory with memory ordering semantics. Lists are array-backed collections of int and long primitives to avoid boxing. Maps and sets use open addressing with linear probing, keyed by int or long primitives, mapping either to object references or to int and long values. There is a set-associative cache with primitive keys to object references, and there are lock-less queues for low latency.

Two items are worth separating from the list. Ring and broadcast buffers are implemented off-heap for IPC communication, which means the data path between processes can avoid the Java heap entirely. The scalable timer wheel schedules timers at a given deadline with O(1) register and cancel time, a complexity claim the README states directly. Around these sit supporting pieces: clock implementations that abstract the system clock and allow caching for testability, off-heap counters for telemetry and position tracking, InputStream and OutputStream wrappers over direct buffers, a DistinctErrorLog that avoids filling disks the way ordinary logging does, an IdGenerator implementing a lock-less variant of the Twitter Snowflake algorithm, and code generation from annotated implementations specialised for primitive types. The last one is the tell: rather than hand-write every primitive variant, Agrona generates them, which is why the library can offer int and long versions of so many structures without a combinatorial mess in the source tree.

Installing Agrona and building it from source

The README points to Maven Central for the latest release and downloads, so the normal route is a build-tool dependency rather than a manual download. The current release line is 2.6.x, with 2.6.1 published on 2026-09-17 according to the release list. If you build from source instead, the README says to use Gradle with the project's build.gradle and that you need the latest release of Java 17; it states Agrona is tested with Java 17, 21, 25 and the next available EA build.

The README gives one command for the full clean and build of the project itself, which is what you run after cloning if you want to build from source rather than consume the artifact:

bash
./gradlew

That is the whole build instruction the README provides. It does not spell out a Maven or Gradle dependency snippet, so take the group and artifact identifiers from the Javadoc badge (org.agrona) and the Maven Central listing rather than guessing a version string. The README also does not document a first-use example, so the entry point for any specific class is the Javadoc, not the README. Start with the buffer family, which the README describes as thread-safe direct and atomic buffers with memory ordering semantics, and check the Javadoc for the exact class name, constructor and ordering methods before writing production code.

Where Agrona is the wrong tool

Agrona is a poor fit when the problem is ordinary application data. Primitive-keyed maps and sets exist to dodge boxing and to control probing; if your keys are strings or composite objects, the library's advantage largely evaporates and you are left with an unfamiliar API. The same applies to the lock-less queues: they are aimed at low-latency handoff between threads, and a general task queue with blocking semantics and backpressure is a different design problem that the README does not claim to solve.

The second limitation is operational. Off-heap memory is not managed by the garbage collector, so the bounds and lifetimes are yours to enforce. The README does not document a safety net for a buffer that is written past its capacity or reused after the underlying memory is released. That is the trade: predictable latency in exchange for manual discipline. A team that has not worked with direct buffers before will find this library unforgiving, and the README will not walk them through the failure modes.

The third is documentation depth. The README is a catalogue, not a guide. It lists what exists and points to Javadoc and a Change Log wiki page. There is no tutorial, no migration guide in the README, and no statement about rollback or compatibility guarantees between minor versions. For a library that sits under a transport, that silence matters more than it would for a utility jar.

Agrona compared with the JDK collections and Chronicle

The obvious alternative is the JDK itself. Java's HashMap, ArrayList and ArrayDeque are general, well documented and safe by default. The difference is in the representation: JDK collections box primitives, so an int key becomes an Integer object, and the JDK has no off-heap buffer beyond ByteBuffer. Agrona's maps use open addressing with linear probing on primitive keys, and its buffers address memory outside the heap with explicit ordering. If your profile shows allocation or GC pauses coming from collection traffic, that is the specific gap Agrona fills.

The closer comparison is Chronicle, which also targets off-heap data and low-latency Java. The approaches differ in scope: Agrona ships as data structures and utilities meant to be composed into a system, and its README positions the library as the foundation under Aeron and the Simple Binary Encoding codec, with an agent framework and a timer wheel alongside the containers. Chronicle's family centres on persisted, memory-mapped data structures and queues as products in their own right. Neither is a superset of the other, and the deciding question is whether you want a bag of primitives to build a transport with, or a managed off-heap store. Agrona assumes you are building the former.

Maintenance, release cadence and the Apache-2.0 licence

The repository is not archived, and the last push was on 2026-09-23. The release list shows 2.5.0 on 2026-07-03, 2.6.0 on 2026-08-20 and 2.6.1 on 2026-09-17, so minor releases have been landing roughly every six to eight weeks through the 2.6 line. The README points to a Change Log wiki page for version information and changes, which is where an upgrade review should start, because the README itself carries no compatibility statement.

The upgrade cost is the usual one for a library of this kind: the surface is broad (buffers, maps, sets, queues, counters, timers, code generation), and a minor bump can touch any of it. The presence of agrona-benchmarks and agrona-concurrency-tests as top-level modules means the project carries its own performance and concurrency test suites, which is a signal about how changes are validated, though the README does not describe how to run them or what they assert.

On licensing: the LICENSE file is Apache-2.0, and the README reproduces the standard notice, including the copyright line "Copyright 2014-2025 Real Logic Limited." and the disclaimer that the software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. Apache-2.0 is permissive and includes an express patent grant, but the README does not address attribution obligations for redistributed binaries or the NOTICE file, so confirm those details against the LICENSE file itself rather than this summary. Nothing here is legal advice.

Editorial conclusion

Adopt Agrona if you are building low-latency Java infrastructure and already accept off-heap memory, manual buffer lifetimes and primitive-specialised collections; the library is published on Maven Central and the last push to the repository was on 2026-09-23. Do not adopt it as a general-purpose collections replacement, because its maps, sets and lists exist to avoid boxing and allocation in specific shapes, and the README does not present it as a drop-in substitute. Before committing, verify the Javadoc for the exact buffer or queue class you plan to use, confirm that your build targets Java 17 or later, and read the Change Log wiki page for the 2.6.x line to see what moved between 2.5.0, 2.6.0 and 2.6.1.

Frequently asked questions

What Java version does Agrona require?

The README says you need the latest release of Java 17 to build Agrona, and that the project is tested with Java 17, 21, 25 and the next available EA build.

Where do I download Agrona from?

The README states that the latest release and downloads can be found in Maven Central, under the org.agrona group shown by the Javadoc badge.

What is Agrona used for inside Aeron?

The README says many of Agrona's utilities are used in Aeron, the reliable UDP unicast, multicast and IPC message transport, and that it provides high-performance buffer implementations to support the Simple Binary Encoding message codec.

Official sources

  1. aeron-io/agrona on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/aeron-io-agrona.svg)](https://hysenlabs.com/projects/aeron-io-agrona)