Is there any open-source alternative for Terracotta BigMemory?
Actually I didn\'t even manage to find any commercial alternative. I\'m interested in pure Java soluti
https://github.com/raffaeleguidi/DirectMemory
Although it isn't a solution, a guide to how to make use of ByteBuffers for your use case has been written about by Keith Gregory. Take a look at http://www.kdgregory.com/programming/java/ByteBuffer_JUG_Presentation.pdf for an overview and http://www.kdgregory.com/index.php?page=java.byteBuffer for the nitty-gritty details.
I've been having this question myself so I'm just going to update the previous answers with my findings.
I found this thread from quora which also talks about the same question:
http://www.quora.com/JVM/Whats-the-best-open-source-solution-for-java-off-heap-cache
The different solution that seem to be a good fit, besides the directmemory (which has not really been updated in the last year) are
However, I would be interested furthermore to find a big enough application that is using any of these three: directmemory, SpyMemcached, xmemcached. Should I find one I will update this answer.
This implementation of a java off-heap cache uses direct memory and provides good performance in a light-weight java library:
https://github.com/snazy/ohc
Take a look at the benchmarking section for performance numbers. It's licensed under Apache 2.
There is a very good cache solution named MapDB(JDBM4 formerly). It supports HashMap
and TreeMap
But it is only application embedded. It also support persistent file based cache.
Example for off heap cache:
DB db = DBMaker.newDirectMemoryDB().make();
ConcurrentNavigableMap<Integer, String> map = db.getTreeMap("MyCache");
Or persistent file based cache:
DB db = DBMaker.newFileDB(new File("/home/collection.db")).closeOnJvmShutdown().make();
ConcurrentNavigableMap<Integer,String> map = db.getTreeMap("MyCache");
Looks like there is a proposal at apache:
http://wiki.apache.org/incubator/DirectMemoryProposal