How come all ConcurrentMap (key, value) pairs are stored in memory?

时间:2019-04-14 16:49:56

标签: jvm guava concurrenthashmap

I was reading this article about Guava cache, which states:

A Cache is similar to ConcurrentMap, but not quite the same. The most fundamental difference is that a ConcurrentMap persists all elements that are added to it until they are explicitly removed.

How can one know that ConcurrentMap elements are always stored in memory? Surely, if the JVM memory limit is reached they will be evicted?

What does ConcurrentMap do to ensure the JVM keeps its elements in memory?

I was looking over the Guava ConcurrentMap implementation but I still didn't understand.

0 个答案:

没有答案