In a caching class (Java 8) i have the following definition of a cache:
private static volatile LinkedHashMap<String, MyCacheItem> CACHE = null;
The size is limited to 4000 entries (guaranteed by implementing the removeEldestEntry()
method of the LinkedHashMap
.
While this limiting aspect works fine, i see this when taking a memory dump (hprof
) of the JVM:
This all looks good, one LinkedHashMap$Entry one after the other.
However suddenly there appear other elements under CACHE
:
Can somebody explain why other data is suddenly appearing under CACHE? I did not expect that.