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 solution which will work inside JVM without any JNI and C-backed solution.
Ehcache is an open-source implementation of the JSR-107, which is reported to be the most used Java-based cache (URL-2, 2020).
Geode can be configured to store region values in off-heap memory, which is memory within the JVM that is not subject to Java garbage collection.
The Java Object Cache provides caching for expensive or frequently used Java objects when the application servers use a Java program to supply their content. Cached Java objects can contain generated pages or can provide support objects within the program to assist in creating new content.
The off-heap store extends the in-memory store to memory outside the of the object heap. This store, which is not subject to Java garbage collection (GC), is limited only by the amount of RAM available. Because off-heap data is stored in bytes, only data that is Serializable is suitable for the off-heap store.
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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With