Is performance with maxElementsInMemory too big in ehcache configuration

I just wanted to know if the performance impact on the maxElementsInMemory installation was much higher than it really is? For example, a maximum of 10,000 and using only 100.

ehcache.xml

<defaultCache
    eternal="false"
    overflowToDisk="false"
    maxElementsInMemory="10000"
    timeToIdleSeconds="7200"
    timeToLiveSeconds="0"/>

Context: I use ehcache with hibernate, and I want all table entries (of all entities) to be cached. From one client to another, the number of entries in this table varies, so it is difficult to set the exact maximum.

Thank!

Mark

+5
source share
1 answer

No no. This is just the maximum value. If your cache contains only 100 objects, you will pay the cost of a card containing 100 elements. The upper limit here has nothing to do.

( ConcurrentHashMap), .

+3

All Articles