3 Replies Latest reply on May 20, 2006 12:18 AM by ybh6336

    InterruptedException in JBossCache

    ybh6336

      Hello all,

      I am using the cache (version 1.2.3) to store some serialized java objects that we hold in the database. I'm not using the persistent features of the cache, but just storing the objects after the first hit to the database. I don't need to evict the objects since they don't change very often (have another interface to forcefully evict the objects from the cache), so I have timeToIdleSeconds as 0. Everything is fine, but when we hit the application with about 25 simultaneous threads in a loop count of over 1000, the application just hangs after running fine for more than 2 hours. Looking at the thread dump, I saw the following trace in the logs:

      java.lang.InterruptedException
       at java.lang.Object.wait(Native Method)
       at java.lang.Object.wait(Object.java:429)
       at EDU.oswego.cs.dl.util.concurrent.BoundedBuffer.put(BoundedBuffer.java:109)
       at org.jboss.cache.eviction.Region.putNodeEvent(Region.java:101)
       at org.jboss.cache.eviction.Region.setVisitedNode(Region.java:91)
       at org.jboss.cache.eviction.LRUPolicy.nodeVisited(LRUPolicy.java:104)
       at org.jboss.cache.TreeCache.notifyNodeVisisted(TreeCache.java:3192)
       at org.jboss.cache.TreeCache._get(TreeCache.java:1564)
       at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jgroups.blocks.MethodCall.invoke(MethodCall.java:236)
       at org.jboss.cache.interceptors.CallInterceptor.invoke(CallInterceptor.java:33)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:41)
       at org.jboss.cache.interceptors.LockInterceptor.invoke(LockInterceptor.java:167)
       at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:41)
       at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:35)
       at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3116)
       at org.jboss.cache.TreeCache.get(TreeCache.java:1571)
       at org.jboss.cache.TreeCache.get(TreeCache.java:1555)
      


      My cache configuration is very simple and looks as follows:

      <server>
       <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
       <!-- Name of the eviction policy class. -->
       <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
       <!-- Specific eviction policy configurations. This is LRU -->
       <attribute name="EvictionPolicyConfig">
       <config>
       <attribute name="wakeUpIntervalSeconds">86400</attribute>
      
       <!-- Cache wide default -->
       <region name="/_default_">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToIdleSeconds">43200</attribute>
       </region>
      
       <region name="/a/b/c">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToIdleSeconds">0</attribute>
       </region>
      
       <region name="/a/b/d">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToIdleSeconds">0</attribute>
       </region>
      
       </config>
       </attribute>
       </mbean>
      </server>
      


      The application servers I have tested against are JBoss 4.0.2, Weblogic 8.3 and WebSphere 5.1.1, and it occurs on all platforms: AIX, Windows, Linux.

      I would really appreciate if anyone could provide some lead on the issue.

      Thanks
      -Yogesh


        • 1. Re: InterruptedException in JBossCache
          genman

          If you don't need eviction, comment out all the eviction related XML elements.

          Alternatively, you might want to change the wakeUpIntervalSeconds to something smaller, like 5.

          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=78069&view=previous

          • 2. Re: InterruptedException in JBossCache
            ybh6336

            Thanks for the response, according to the docs:

            wakeUpIntervalSeconds. This is the interval (in seconds) to process the node events and also to perform sweeping for the size limit and age-out nodes.
            


            I might be wrong here, but the reason I kept it to a high value was that I did not want the eviction thread to be looking at the regions/nodes too frequently and degrade performance. Is my understanding flawed here? (or can I just get rid of that attribute?) . Also, when you say "comment out all the eviction related XML elements", do you mean the attribute 'timeToIdleSeconds'?

            Thanks
            -Yogesh

            • 3. Re: InterruptedException in JBossCache
              ybh6336

              Great lead genman! I indeed had to lower down 'wakeupIntervalSeconds'. I turned on logging in jboss-cache and found the following:

              putNodeEvent(): eviction node event queue size is at 98% threshold value of capacity: 200000 You will need to reduce the wakeUpIntervalSeconds parameter.
              


              Changed it to 10 seconds, and everything is smooth now. Thanks a lot. This forum has turned out to be helpful again.

              -Yogesh