Lazy
Lazy

Reputation: 277

ehcache RAM only mode

I'd like to use as much RAM as possible with ehcache but ehcache still uses some space on harddrive. this is my config

name="MainCacheManager"
overflowToDisk="false"
diskPersistent="false"
updateCheck="true"
monitoring="autodetect"
dynamicConfig="true"
maxBytesLocalHeap="2G"
maxBytesLocalDisk="1M"

Is it possible to disable swap at all?

Also this value doesn't work

maxBytesLocalDisk="1M"

ehcache swap takes much more space than 1M

Upvotes: 0

Views: 261

Answers (1)

Louis Jacomet
Louis Jacomet

Reputation: 14500

Ehcache uses a tiering model in recent versions (2.6+). This means that the lower tier, also called authority, will always contain all the entries from the cache.

So you should never configure a disk store to be smaller than the onheap store, as it will limit the cache capacity.

If you do not want a disk store, drop the maxBytesLocalDisk="1M" config line.

Also, the disk store of ehcache should not be compared to a swap file.

Upvotes: 1

Related Questions