I just found Guava by searching for a cache API (it fits perfectly for my needs). But one question arose on reading the wiki and Javadoc - what are the default values of settings the CacheBuilder can take? The Javadoc states "These features are all optional" and "Constructs a new CacheBuilder instance with default settings, including strong keys, strong values, and no automatic eviction of any kind."
In my opinion, a good default for maximumSize
would be relative to Runtime.getRuntime().freeMemory();
At the end I want a cache that uses the memory available on a given system. So I need an eviction strategy that asks how much freeMemory()
is available (probably relative to Runtime.getRuntime().maxMemory()
)