3 Replies Latest reply on Aug 1, 2011 9:13 AM by Vladimir Blagojevic

    eviction is not working, causing memory leaks

    omer zohar Newbie

      Im using infinispan 4.2.1 as embedded cache on Jboss AS 6 cluster. we're using two caches: one distributed (for long term storage, backed by berekely db) and one replicated (for short tasks, memory only).

      the items we put in the cache tend to be big. usually up to 10MB a key of string data/POJOs

      on both caches i have eviction set up every 10 seconds, with expiration of 1 hour to the replicated cache and 24Hrs to the distributed.

      i also limited the maxEntries on both items to 256.

      problem is, i dont see eviction occuring anywhere. on JMX console for both caches, eviction = 0 .

      i even tried programmically calling the evict (), but that doesnt seem to do anything.

      i see a lot of cached entries fill up my memory, far beyond the set limit, lurking in my Old Gen filling it up until i get an OOM exception.

      i have tried all sort of cache settings, but had not success getting rid of that memory leakage. what am i doing wrong here?

       

      my infinispan-config.xml:

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:4.2">
      
      
          <global>
              <transport 
                  clusterName="${jboss.partition.name:DefaultPartition}-blackBoxCache" 
                  distributedSyncTimeout="17500"
                  nodeName="Node91"
              >
                <properties>
                  <property name="stack" value="${jboss.default.jgroups.stack:udp}"/>
                </properties>
              </transport>
              <globalJmxStatistics 
                  enabled="true" 
      
              />
              <!--shutdown hookBehavior="DONT_REGISTER"/-->
              <shutdown hookBehavior="DEFAULT"/>
          </global>
           
          <default>
              <locking isolationLevel="READ_COMMITTED" 
                       lockAcquisitionTimeout="30000" 
                       useLockStriping="false" 
                       concurrencyLevel="5000"
                       writeSkewCheck="false"/>
              <jmxStatistics enabled="true"/>
              <lazyDeserialization enabled="false"/>
              <invocationBatching enabled="true"/>   
              <eviction wakeUpInterval="5000" strategy="LRU"/>
              
              <clustering mode="replication">
                   <!--defines whether to retrieve state on startup.  This is only valud for 'replication' mode.     -->
                   <stateRetrieval
                      timeout="60000"
                      fetchInMemoryState="false"
                      alwaysProvideInMemoryState="false"
                   />
                   <!--Network calls are synchronous. -->
                   <sync replTimeout="20000"/>
              </clustering>
          </default>
            
        <!-- WORKING IN MEMORY CACHE -->
          <namedCache name="working">
              <clustering mode="replication">
                    <stateRetrieval
                      timeout="60000"
                      fetchInMemoryState="false"
                      alwaysProvideInMemoryState="false"
                  />
                  <!--Network calls are synchronous. -->
                  <sync replTimeout="20000"/>
              </clustering>
      
              <expiration lifespan="3600000" maxIdle="3600000"/> <!-- Removing entries not been accessed in over an hour -->
              <eviction wakeUpInterval="10000" maxEntries="256" strategy="LIRS"/>
          </namedCache>
      
       <!-- DATA PERSISTANT CACHE -->
          <namedCache name="storage">
            
              <clustering mode="distribution">
                <stateRetrieval timeout="60000" fetchInMemoryState="false"/>
                <async useReplQueue="false"/>         
                <hash
                  numOwners="2"
                  rehashWait="120000"
                  rehashRpcTimeout="600000"
                />
                <l1 enabled="false" />
              </clustering>
              
              <loaders passivation="false" shared="false" preload="false">
                 <loader class="org.infinispan.loaders.bdbje.BdbjeCacheStore" fetchPersistentState="false" purgeOnStartup="false">
                  <properties>
                    <property name="location" value="${jboss.server.data.dir}${/}blackbox.cache"/>
                  </properties>
                  <!--async enabled="true" threadPoolSize="10" flushLockTimeout="20000" /-->
                </loader>
              </loaders>
              
      
              <eviction wakeUpInterval="10000" maxEntries="256" strategy="LIRS"/>
              <expiration lifespan="86400000" maxIdle="-1"/>
          </namedCache>
        
      </infinispan>