Reputation: 3926
EHCache version 3.2
How do I evaluate "ehcache:resources" ?
File: ehcache.xml
<ehcache:cache alias="messageCache">
<ehcache:key-type>java.lang.String</ehcache:key-type>
<ehcache:value-type>org.cache.messageCacheBean</ehcache:value-type>
<ehcache:resources>
<ehcache:heap unit="entries">10</ehcache:heap>
<ehcache:offheap unit="MB">1</ehcache:offheap>
</ehcache:resources>
</ehcache:cache>
Assume.
Table Name: Message have 4 columns type varchar2(100 Byte) and have data 1000 rows or more than in the database.
How much provide enough define heap/offheap value ?
Thank you.
Upvotes: 0
Views: 2163
Reputation: 14500
Sizing caches is part of the exercise and does not really have a general answer.
However, understanding a bit how Ehcache works is needed. In the context of your configuration:
One thing you can do to help onheap tier sizing is to move to byte size in one test. While it will have a performance impact, it will enable you to evaluate how much memory a mapping takes. And thus derived how much mapping fit in the memory you are ready to spare.
Upvotes: 1