0

I have set up a Spring cache manager backed by a ConcurrentMapCache for my application.

I am seeking for ways to monitor the cache and especially make sure the data in cache fits in memory. I considered using jvisualvm for that purpose but there might be other ways... If so what are they?

So my question is basically twofold:

  • What is the best way to monitor a cache backed by a ConcurrentMapCache?
  • What are the general guidelines for setting the time to live and cache size values of a cache?
4

1 回答 1

1

看起来您正在搜索 JVM 提供的“简单”映射实现不能也不会提供的缓存相关功能。

有许多缓存提供程序可以提供您想要的东西,即监控、限制缓存大小并为缓存元素提供 TTL 合同。我鼓励您环顾四周并切换您的CacheManager实现,这将对您的代码产生零影响,因为您使用的是抽象。

于 2014-06-16T11:59:32.557 回答