Off-Heap Mapish

A high-performance, single-threaded, off-heap java.util.Map implementation using Java's Foreign Function & Memory (FFM) API.

var map = new OffHeapMap<>(
    new StringSerializer(100),
    new StringSerializer(100),
    2_000_000
);

map.put("stay", "tuned");
map.get("stay"); // "tuned"

Zero GC Pressure

Bypasses the Java Garbage Collector for table nodes. Memory is stored entirely natively via Arena.ofConfined() or ofAuto().

Cache Locality

Uses Open Addressing with Linear Probing in a single, contiguous MemorySegment. Say goodbye to scattered LinkedList pointers.

Super Fast

Direct bit-comparisons using MemorySegment.mismatch() completely eliminate expensive string or object deserialization on lookups.

How Does Mapish Compare?

Three off-heap Java map libraries, three radically different architectures.

Dimension Mapish Yahoo Oak MapDB
Thread Safety Single-threaded Thread-safe Thread-safe
Memory API FFM (Java 21+) sun.misc.Unsafe DirectByteBuffer
Persistence In-memory In-memory Disk + Transactions
Dependencies Zero Multiple Multiple
java.util.Map Full compliance Custom API ConcurrentMap

Get Started in Minutes

Add Mapish to your Gradle project, choose a serializer, and start putting data off-heap. Full java.util.Map API — no new interface to learn.

Read the Tutorial →