0

我正在测试东西,目前生成并插入 1048576ish 条目到缓存中。

ehcache 设置为在溢出到磁盘之前接受 1048579 个条目,这很有效。除了甚至在它溢出到磁盘之前,还有 1048576ish DiskMarkers 并且它们使用的堆比我的实际元素少一点。

有没有办法让ehcache在写入磁盘之前不创建DiskMarker?

ehcache.xml 如下:

<ehcache>
  <diskStore path="/home/deepy/cache"/>
<cache 
    name="first" 
    maxElementsInMemory="1048579"
    eternal="true"
    overflowToDisk="true"
    memoryStoreEvictionPolicy="LFU"
    diskPersistent="false" />
</ehcache>
4

1 回答 1

0

正如在这里向我解释的那样,这是预期的行为。

因此,如果您正在寻找 LFU 缓存,那么选择 ehcache 是没有意义的,除非您的条目比 DiskMarkers 大得多。

于 2013-04-24T10:10:00.597 回答