好像默认是放在内存里了,你看看你的Tomcat占用内存大不?
我的Tomcat内存占用不小,写到硬盘上的话,也是0。

解决方案 »

  1.   

    <defaultCache maxElementsInMemory="100" eternal="false"
    timeToIdleSeconds="300" timeToLiveSeconds="180" diskPersistent="false"
    diskExpiryThreadIntervalSeconds="120" overflowToDisk="false" />
    overflowToDisk:如果为true,表示当基于内存的缓存中的对象数目达到了maxElementsInMemory界限后,会把益出的对象写到基于硬盘的缓存中。这样懂了吗?
      

  2.   

    正解,其实楼主注意一下ehcache.xml里面的注视就能看到的
            overflowToDisk    - Sets whether elements can overflow to disk when the in-memory cache
                                has reached the maxInMemory limit.