Skip to content

About

A library that provides a set of map and cache implementations that store data outside of the normal Java heap

Topics

Resources

Stars

103 stars

Watchers

28 watching

Forks

Latest commit

 

History

241 Commits

Folders and files

Repository files navigation

OffHeap Store

OffHeap Store is a library that provides a set of map and cache implementations that store data outside of the normal Java heap. Additionally it provides a bunch of interesting things to support these functions that might be interesting in isolation to some people.

Licensed under the Apache License, Version 2.0
© Terracotta, Inc., a Software AG company
© IBM Corp. 2024, 2025

Build Status

What’s Available

On the surface OffHeap Store contains implementations of:

  • Map (non thread-safe)

  • ConcurrentMap (single stripe or segmented; read-write locked or exclusively locked)

  • Set (but use Collections.newSetFromMap(Map) instead)

  • Clock Cache (single stripe or segmented; read-write locked or exclusively locked)

Additional functionality includes:

  • Cache Entry Pinning

  • Eviction Listeners

  • Non-fault tolerant disk backend

Things that might be interesting to some:

  • Per entry metadata (very basic API)

  • Serialization optimization (redundant ObjectStreamClass descriptor compression)

  • Native heap-alike implementation (OffHeapStorageArea)

  • A (crude) weak identity hash map (because the world needed one more)

Structure

Like all software OffHeap Store is just a big stack of abstractions, rough structure starting at the bottom and working up.

BufferSource

ByteBuffer factories [org.terracotta.offheapstore.buffersource]

PageSource

Page factories, that uses ByteBuffers) [org.terracotta.offheapstore.paging]

OffHeapStorageArea

native heap-alike that uses pages)

StorageEngine

provide storage for POJOs, some use OffHeapStorageArea)

OffHeapHashMap

core map implementation, uses storage engine for K/V storage and a page for the hashtable.

a million subclasses

all the map derivatives: concurrent, evicting (caches), et al.

About

A library that provides a set of map and cache implementations that store data outside of the normal Java heap

Topics

Resources

Stars

103 stars

Watchers

28 watching

Forks

Releases

Packages

Used by

Contributors

Languages