I would like to know the default expiration policy of Guava caching. My need is , write once and read many times. The cache should never expire. Is this the default behavior of Guava ?
README.md. A Guava cache extension that allows caches to persist cache entries when they cannot longer be stored in memory. An implementation that overflows to the file system is provided including a corresponding CacheBuilder with similar semantics than the Guava CacheBuilder .
The Guava Cache is an incremental cache, in the sense that when you request an object from the cache, it checks to see if it already has the corresponding value for the supplied key. If it does, it simply returns it (assuming it hasn't expired).
Guava's cache is built on top of Java 5's ConcurrentHashMap with a default concurrency level of 4. This setting is because that hash table is segmented into multiple smaller tables, so more segments allows for higher concurrency at a cost of a larger memory footprint.
Assuming you are talking about CacheBuilder
From the Google docs
By default cache instances created by CacheBuilder will not perform any type of eviction.
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