开发者

Does ConcurrentLRUCache/HashMap ever touch disk?

A lot of 开发者_JAVA百科disk activity while I warm my cache up. I can't determine if the org.apache.lucene ConcurrentLRUCache is doing it or not? (The class in question uses the Java ConcurrentHashMap).

tia Rene


I'd say that the most likely cause is that the warmup is causing lots of cache misses, and that is causing Lucene to do lots of queries against its disk indexes, etc. In other words, you are getting what you asked for.

Data points:

  • The Java class ConcurrentHashMap doesn't touch the disk.

  • The source code for Lucene class is here (for example), and it doesn't reference any classes that might explicitly cause disk activity ... apart from sfl4j logging.

Other possible causes of disk activity during "warmup" might include:

  • Java class loading (but that would mostly happen before cache warmup), or
  • virtual memory thrashing due to shortage of physical memory.

It is theoretically possible that Lucene persists the entire cache, and Lucene is loading the serialized cache. However, that sounds such a terrible idea that I'm prepared to dismiss it out of hand. (Besides, this would result in a relatively small amount of disk activity.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜