[ 
http://jira.jboss.com/jira/browse/JBCACHE-31?page=comments#action_12314430 ]
     
Bela Ban commented on JBCACHE-31:
---------------------------------

Program to run is:
package org.jboss.cache.tests;

import org.jboss.cache.TreeCache;
import org.jboss.cache.PropertyConfigurator;

import java.util.Date;
import java.util.HashMap;

/**
 * @author navin
 */
public class CacheMemTest {

   public CacheMemTest(String num) throws Exception {
      TreeCache cache=new TreeCache();
      // cache.setCacheMode(TreeCache.REPL_ASYNC);
      // cache.setClusterName("CacheTest");

      PropertyConfigurator conf=new PropertyConfigurator();
      conf.configure(cache, "async.xml");
      
      cache.createService();
      cache.startService();

      new Thread(new PublishThread(cache, num, 1)).start();
      new Thread(new PublishThread(cache, num, 2)).start();
      new Thread(new PublishThread(cache, num, 3)).start();

   }

   public static void main(String[] args) throws Exception {
      new CacheMemTest(args[0]);
   }

   public class PublishThread implements Runnable {
      private TreeCache cache=null;
      private int threadNum=0;
      private String processNum=null;

      public PublishThread(TreeCache cache, String processNum, int threadNum) {
         this.cache=cache;
         this.threadNum=threadNum;
         this.processNum=processNum;
      }

      public void run() {
         while(true) {
            try {
               System.out.println(processNum + "/" + threadNum);
               cache.put(processNum + "/" + threadNum, "EXPIRY_TIME", new 
Date(System.currentTimeMillis() + 5000));

               HashMap testMap=new HashMap();
               testMap.put("TIME_NAME", new Date(System.currentTimeMillis()) + 
"_NAME");
               testMap.put("TIME_HOST", new Date(System.currentTimeMillis()) + 
"_HOST");
               testMap.put("TIME_PORT", new Date(System.currentTimeMillis()) + 
"_PORT");
               testMap.put("TIME_THREAD_COUNT", new 
Date(System.currentTimeMillis()) + "_100");
               testMap.put("TIME_FREE_MEMORY", new 
Date(System.currentTimeMillis()) + "_1024");
               testMap.put("TIME_MZX_MEMORY", new 
Date(System.currentTimeMillis()) + "_2048");

               cache.put(processNum + "/" + threadNum, "STATISTICS", testMap);

               Thread.sleep(500);
            }
            catch(Throwable t) {
               System.out.println("Error in Thread" + threadNum + " : " + t);
               t.printStackTrace();
            }
         }
      }
   }
}


> Out of memory problem
> ---------------------
>
>          Key: JBCACHE-31
>          URL: http://jira.jboss.com/jira/browse/JBCACHE-31
>      Project: JBoss Cache
>         Type: Bug
>     Versions: 1.2
>     Reporter: Bela Ban
>     Assignee: Bela Ban
>     Priority: Critical
>      Fix For: 1.2.1

>
> Original Estimate: 1 week
>         Remaining: 1 week
>
> I was able to reproduce the OOME using a simple java program using JBossCache.
> > >
> > >I have attached a java program "CacheMemTest.java" that mimicks our
> > >actual scenario (3 threads / process posting to the same JBossCache
> > >into the same node every time).
> > >
> > >I ran 5 instances of this program in different JVMs in the background.
> > >I passed numbers 1 to 5 as the arguments to the 5 programs (for the
> > >processNum).
> > >
> > >After about 3 hours, the program started throwing OOMEs.. The stack
> > >trace for each of them was :
> > >
> > >org.jboss.util.NestedRuntimeException: - nested throwable:
> > >(java.lang.OutOfMemoryError)
> > >        at java.lang.Thread.run(Thread.java:552)
> > >Caused by: java.lang.OutOfMemoryError
> > >org.jboss.util.NestedRuntimeException: - nested throwable:
> > >(java.lang.OutOfMemoryError)
> > >        at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3184)
> > >        at org.jboss.cache.TreeCache.put(TreeCache.java:1741)
> > >        at org.jboss.cache.TreeCache.put(TreeCache.java:1724)
> > >        at CacheMemTest$PublishThread.run(CacheMemTest.java:65)
> > >
> > >Is this a known problem? Any idea how I can go about debugging this 
> > >problem?
> > >
> > >Navin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to