1

I would like to ask if anyone knows a JAVA Caching Framework with the following properties:

  • I have big data files (2mb up to 5gb), which i need to serialize if the memory increases and deserialize them on demand.

  • Last recently used strategy

  • I want to handle serialization/deserializtion on my own, this means i just want to know from the framework when I have to serialize. Deserializing is on user demand.

  • I want to have minimum IO as I have big data

If there is no direct framework for this, maybe you can point me to a heuristik or any other strategy? SoftReferences/WeakReference as a solution do not work, as i can't serialize, even if I get noticed when they are garbage collected (to less memory left for serializing or even worse: file gone before serialization).

Thanks!

user1654885
  • 131
  • 1
  • 3
  • 8
  • 1
    Possibly a duplicate [Write caching](http://stackoverflow.com/questions/8431969/how-to-implement-a-write-cache-that-swaps-data-to-disk-only-when-free-memory-is) – Durandal Sep 07 '12 at 13:57

4 Answers4

4

Try Ehcache . Ehcache is an open source, standards-based cache used to boost performance, offload the database and simplify scalability. Ehcache is robust, proven and full-featured and this has made it the most widely-used Java-based cache

NIlesh Sharma
  • 5,445
  • 6
  • 36
  • 53
4

(disclaimer - I work for GigaSpaces)

GigaSpaces XAP DataGrid provides a full object oriented Java caching solution.

  • Storage type - Different storage types can be assigned to different parts of the data. Also XAP supportd Extrenal Data Source integration such as DB and NoSQLto allow offloading of big data.
  • Eviction policy - Different eviction policies can be set including LRU.
  • The storage type uses Java serialization as such one can implement Externalizable and gain full control.
  • XAP is extremely efficient in using network resource and IO in general.
Guy Korland
  • 9,139
  • 14
  • 59
  • 106
  • ok, anyone out there without any interest sellings his software? i need this for an open-source project. there is no DB in the background. – user1654885 Sep 10 '12 at 06:55
1

The JCache API is in public draft (as of August 2013), and will come with an open source reference implementation (RI). All of the major caching vendors (e.g. Oracle Coherence, ehCache) and open source projects will provide a JCache binding for their implementations, so it's worth taking a look.

See: https://github.com/jsr107

Update (11 July 2014) - The JCache API is completed and released several months ago as a standard.

If you need an implementation of JCache, the only one that I'm aware of being available today is Oracle Coherence; see: http://docs.oracle.com/middleware/1213/coherence/develop-applications/jcache_part.htm

For the sake of full disclosure, I work at Oracle. The opinions and views expressed in this post are my own, and do not necessarily reflect the opinions or views of my employer.

cpurdy
  • 1,177
  • 5
  • 12
  • What is the lightest `javax.cache` provider? My application will never works in clusters, remote cache etc. All "in RAM" and simple file cache libraries i have found doesn't implement `javax.cache`. I have knowledge, use i.e ehcache, but many MB install (and configuration, log activity etc) is horrible for small desktop application. – Jacek Cz Sep 03 '15 at 07:37
0

Check on the Redis - Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. For more details click on Redis

kds
  • 28,155
  • 9
  • 38
  • 55