overflowToDisk: sets whether items can overflow to disk when the storage has reached the maxInMemory limit.
As I understand it, it will not write to disk unless memoryStoresSize reaches maxElementsInMemory. But this does not seem to be the case.
I have a simple cache as follows:
<cache name="cache" maxEntriesLocalHeap="100000" eternal="true"
overflowToDisk="true" statistics = "true">
<terracotta clustered="false"/>
</cache>
And I printed statistics when getting values from the cache.
System.out.println("memory size:" + cache.getMemoryStoreSize());
System.out.println("disk size:" + cache.getDiskStoreSize());
But the output shows that the disk size is not 0, even if the memory size is very small than maxElementsInMemory.
memory size:2
disk size:186
memory size:2
disk size:186
memory size:3
disk size:186
memory size:3
disk size:186
Even the size of the memory is smaller than the size of the disk. How could this happen? or how can I configure it to work as expected?
Thank.
source
share