Skip to content
A ConcurrentLinkedHashMap for Java
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/cache-benchmark First pass for CASSANDRA-4150 (issue 33). Ugly as I need to remove ug… May 5, 2012
src Remove padding as wastes memory (issue #43) Jan 28, 2015
.gitignore Clean-up hamcrest helper to use matchers internally Jan 4, 2013
LICENSE Add license files (issue 38) Jul 29, 2013
NOTES Migrated from Google Code to Github Mar 13, 2015
NOTICE Advocate Caffeine as successor project Apr 9, 2015
pom.xml [maven-release-plugin] prepare for next development iteration Jan 28, 2015

Caffeine is the Java 8 successor to ConcurrentLinkedHashMap and Guava's cache. Projects should prefer Caffeine and migrate when requiring JDK8 or higher. The previous caching projects are supported in maintenance mode.

A high performance version of java.util.LinkedHashMap for use as a software cache. The project was migrated from its old website on Google Code.


  • A linked list runs through a ConcurrentHashMap to provide eviction ordering.
  • Avoids lock contention by amortizing the penalty under lock.

See the design document and the StrangeLoop conference slides (Concurrent Caching at Google).


  • LRU page replacement policy (currently being upgraded to LIRS).
  • Equivalent performance to ConcurrentHashMap under load.
  • Can bound by the size of the values (e.g. Multimap cache).
  • Can notify a listener when an entry is evicted.

See the tutorial for examples of using this library.


See the Changelog for version history.


See the Changelog for more details and current progress.


Maven users should choose one of the dependencies based on their JDK version.

<!-- JDK 6 -->

<!-- JDK 5 -->


In this benchmark an unbounded ConcurrentHashMap is compared to a ConcurrentLinkedHashMap v1.0 with a maximum size of 5,000 entries under an artificially high load (250 threads, 4-cores).



You can’t perform that action at this time.