Skip to main content

ConcurrentLinkedHashMap

Posted by ben_manes on April 29, 2010 at 8:33 PM PDT
Project URL

Summary

A ConcurrentLinkedHashMap for Java

Community: 

StagingA high performance version of java.util.LinkedHashMap for use as a software cache.

Design
  • A linked list runs through a ConcurrentHashMap to provide eviction ordering.
  • Read ordering is buffered per segment and drained when a threshold is crossed.
  • Write-back with consistent ordering within a segment.

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

Status
Released v1.0 with Least-Recently-Used page replacement policy.

Future
Implementing Low Inter-reference Recency Set page replacement policy.

License: 

Apache License, Version 2.0
Related Topics >>