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

后端 未结 8 2434
后悔当初
后悔当初 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:48

    As well as guessing the memory usage of the object, for a reasonable algorithm you would also need to guess the cost of recreating it. A reasonable guess would be the cost of recreation is roughly proportional to memory size. So the factors cancel each other out and you need neither. A simple algorithm is probably going to work out better.

提交回复
热议问题