Start a new topic

InMemoryLRUCache default cache size & unit for cache size parameter

We failed to find any documentation on how big the default cache size is for InMemoryLRUCache in the documentation: http://devcenter.kinvey.com/android/reference/api/java/reference/com/kinvey/java/cache/InMemoryLRUCache.html. There doesn't seem to be a way to get the cache size either.



In addition, what's the unit for cache size parameter for the InMemoryLRUCache constructors?
1 Comment

Hey,



the default cache size is 16 and the default load factor is 0.75 -- these are the defaults of a `LinkedHashMap`, which the implementation is based on from http://docs.oracle.com/javase/6/docs/api/java/util/LinkedHashMap.html



If you want to build your own custom cache, you can just implement the `com.kinvey.java.cache.Cache` interface, which requires a put and a get method-- it is using two generics , one for the type of the keys and one for the type of the values.



I will add these to the javadocs for the class, as it should be more easily accessible.
Login or Signup to post a comment