Any Java caches that can limit memory usage of in-memory cache, not just instance count?

后端 未结 8 2432
后悔当初
后悔当初 2021-02-14 00:08

I am looking for a simple in-memory (and in-process) cache for short-term caching of query data (but short-term meaning beyond request/response, i.e. session boundary). EhCache

8条回答
  •  一生所求
    2021-02-14 00:53

    The thing that does this job is java.lang.ref.SoftReference . Typically, you extend the SoftReference class so that the subclass contains the key.

提交回复
热议问题