-
1. Re: Memory Limit on Infinispan cache
usydrajani Mar 21, 2013 5:17 AM (in response to abhinavshrivastav)Hi
I use Jboss 6. There is file infinispan-configs.xml which comes with infinispan. If you are useing entity cache you can change the config maxEntries. this will tell the eviction thread to leave the number of entries 'maxEntries'
in cache after doing pruning to cache. The maxEntries should be in power of 2
<eviction wakeUpInterval="0" maxEntries="131072" strategy="LRU"/>
Also these is size function in which you can use
eg
I have entity cache named as "infinispan.infinicache.ReviewEntity"
so what I did
@Resource(name = "CacheManager/entity", mappedName = "java:CacheManager/entity")
protected EmbeddedCacheManager cm;
System.out.println("Size of cache ReviewEntity "+cm.getCache("infinispan.infinicache.ReviewEntity").size());
I hope this helps
Meena
-
2. Re: Memory Limit on Infinispan cache
abhinavshrivastav Mar 21, 2013 6:55 AM (in response to usydrajani)Thanks Meena. But if I am using it in clustered mode, can I configure the way keys would be distributed amongst various nodes.
i.e. If have Node 1 and Node 2 in a clustered in distributed mode, then I would want 1 GB from Node 1 to be used and 2GB from Node2.
-
3. Re: Memory Limit on Infinispan cache
usydrajani Mar 21, 2013 7:37 AM (in response to abhinavshrivastav)1 of 1 people found this helpfulI think eviction policy is local policy on each node. So i think it can be possible, you can try that. In waht mode are you runing Infinispan? Invalidation or replication. If you are runing in invalidation than it makes sense to have different size of each cache node. While in Replication I do not think it helps to have cache of different size.
-
4. Re: Memory Limit on Infinispan cache
abhinavshrivastav Mar 21, 2013 7:45 AM (in response to usydrajani)Thanks. I can try that. We are running it in distributed mode.