Reputation: 1363
I am receiving Eh-cache logging output when using it with Hibernate 2nd Level cache - i do not undertand the output and what it might mean. It is being printed to the logs a lot.
DEBUG [net.sf.ehcache.store.disk.Segment] put added 0 on heap
DEBUG [net.sf.ehcache.store.disk.Segment] put updated, deleted 0 on heap
Could anyone shed some light on what this might mean? My Second level cache appears to be working, according to a print of the statistics...
INFO [com.atlaschase.falcon.commands.domain.AircraftCommandResolutionService] [ name = aircraftCache cacheHits = 824 onDiskHits = 0 offHeapHits = 0 inMemoryHits = 824 misses = 182 onDiskMisses = 182 offHeapMisses = 0 inMemoryMisses = 182 size = 91 averageGetTime = 1.0745527 evictionCount = 0 ]
Any help would be appreciated ..
Simon
Upvotes: 1
Views: 2090
Reputation: 340883
This output is generated by DiskStore, IIRC enabled by default in EhCache. Basically EhCache overflows cached data from memory to disk. If you want to disable this functionality, set overflowToDisk
property to flase
:
<cache name="..." overflowToDisk="false"
Oh - can someone also confirm that the 'averageGetTime' is in milliseconds and not seconds?
Confirmed, milliseconds. Although the JavaDoc of Statistics.getAverageGetTime()
is slightly confusing:
[...] Because ehcache support JDK1.4.2, each get time uses System.currentTimeMilis, rather than nanoseconds. The accuracy is thus limited.
I found the following code in LiveCacheStatisticsImpl
:
public float getAverageGetTimeMillis() {
//...
return (float) totalGetTimeTakenMillis.get() / hitCount;
}
Upvotes: 2