Does caffeine loading cache do automatic interning of cached values? #809
-
Hi we're creating a LoadingCache with caffeine with - (1) maxSize (2) variable expiration w/ its builder. cc @ben-manes |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, nothing magical like that. You can think of it as a (We do offer an Interner for those who want that behavior) |
Beta Was this translation helpful? Give feedback.
No, nothing magical like that. You can think of it as a
ConcurrentHashMap
with an automatic removal policy. The entries are shared until evicted, loaded if not found, etc. It does not try to keep them around any longer, e.g. by callingString.intern
. It doesn't copy objects into or out of the map, etc. It should be boring and feel similar to the core Java collections.(We do offer an Interner for those who want that behavior)