I am trying to cache some data using LruCache
in android, say like I have
LruCache<String, SomeDataClass>
And SomeDataClass like
data class SomeDataClass(val data: Any)
My doubt is if am pushing some data to the cache
and by the time cache is full, so LruCache
will automatically evict the least used item and push the new one.
- Is the evicted item will be garbage collected?
- Is it safe to use the already fetched item that was evicted now from the cache?
Can anyone help me out with this?