1 Reply Latest reply on May 18, 2005 9:33 AM by belaban

    TreeCache capacity, why <20% of JVM heapspace?

    kan_deng

      Hi, there,

      We are evaluating TreeCache's capacity, by using it to cache temporary data, without any database connection.

      We configure the JVM heapspace to 1024M, and put as many objects as possible into the cache, to see its upper limit. Each object has a unique key, so that the entire tree has is flat with one level.

      Each object size is of 150k bytes, and we found we can hardly cache 1500 objects into the TreeCache. Therefore, only 225M is used out of 1024M JVM heap space.

      Is there anything wrong with our coding and/or config?

      private final String CONFIG_FILE_PATH = "config/replsync-service.xml";
      TreeCache tree = new TreeCache();
      PropertyConfigurator config = new PropertyConfigurator();
      config.configure(tree, CONFIG_FILE_PATH);
      tree.createService();
      JbossCacheListener lis = new JbossCacheListener();
      tree.addTreeCacheListener(lis);
      tree.startService();
      
      try
      {
       for (int i = 0; i < 2000; i++)
       tree.put(Integer.toString(i), data);
      }
      catch ...


      And in the config, CONFIG_FILE_PATH, we specify,


      <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
       <!-- Specific eviction policy configurations. This is LRU -->
       <attribute name="EvictionPolicyConfig">
       <config>
       <attribute name="wakeUpIntervalSeconds">5</attribute>
       <!-- Cache wide default -->
       <region name="/_default_">
       <attribute name="maxNodes">5000</attribute>
       <!--time to live 1 hour-->
       <attribute name="timeToLiveSeconds">86400</attribute>
       </region>


      We are sure that we must have done something wrong, but what is it?


      many thanks,
      Kan