JBoss.org Community Documentation

9.1.1. Basic Configuration

The basic eviction policy configuration element looks like:



   ...

   <attribute name="EvictionConfig">
      <config>
         <attribute name="wakeUpIntervalSeconds">3</attribute>

         <!-- This defaults to 200000 if not specified -->
         <attribute name="eventQueueSize">100000</attribute>

         <!-- Name of the DEFAULT eviction policy class. -->
         <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>

         <!-- Cache wide default -->
         <region name="/_default_">
            <attribute name="maxNodes">100</attribute>
         </region>

         <!-- override policy used for this region -->
         <region name="/org/jboss/data" policyClass="org.jboss.cache.eviction.LRUPolicy">
            <attribute name="maxNodes">250</attribute>
            <attribute name="minTimeToLiveSeconds">10</attribute>
         </region>

         <!-- We expect a lot of events for this region, 
              so override the default event queue size -->
         <region name="/org/jboss/test/data" eventQueueSize="500000">
            <attribute name="maxNodes">60000</attribute>
         </region>

      </config>
   </attribute>

   ...

  • wakeUpIntervalSeconds - this required parameter defines how often the eviction thread runs
  • eventQueueSize - this optional parameter defines the size of the queue which holds eviction events. If your eviction thread does not run often enough, you may need to increase this. This can be overridden on a per-region basis.
  • policyClass - this is required, unless you set individual policyClass attributes on each and every region. This defines the eviction policy to use if one is not defined for a region.