0 Replies Latest reply on Jul 25, 2007 1:09 PM by BhaktavatsalamReddy

    :: JBossCache - Virtual Memory ::

    BhaktavatsalamReddy Newbie

      Hi,

      I have a question on JBossCache- regarding virtual memory.
      My Environment is:
      Debian Linux
      JBoss4.2.0GA -
      JBossCache that is bundled with JBoss4.2.0
      Hibernate3.2.X
      Ejb3.0.

      When I use the JBossCache as second level cache, it is consuming lot of RAM as well as it is doing lots and lots of swaping., i., paging activitly.
      I could see that on the Linux shell, that very little SWAP memory is left. I think SWAP is some kind of virtual memory. Whey is it doing that much of paging activity. When JVM exhausts it heap memory, it should have raised Out Of Memory Exception. Why is it doing much of SWAP?

      Can any body let me know the best practices for treecache.xml configuration?

      I am quite new to JBossCache.

      Here is my TreeCache.xml

      ?
      <?xml version="1.0" encoding="UTF-8" ?>
      <server>
       <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
      
       <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
       <depends>jboss:service=Naming</depends>
       <depends>jboss:service=TransactionManager</depends>
      
       <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
       <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
       <attribute name="IsolationLevel">NONE</attribute>
      
       <attribute name="CacheMode">LOCAL</attribute>
      
       <attribute name="UseInterceptorMbeans">false</attribute>
      
       <attribute name="LockAcquisitionTimeout">15000</attribute>
      
       <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
      
       <attribute name="EvictionPolicyConfig">
       <config>
       <attribute name="wakeUpIntervalSeconds">5</attribute>
       <region name="/_default_">
       <attribute name="maxNodes">100</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/CompanyImpl">
       <attribute name="maxNodes">10</attribute>
       <attribute name="timeToLiveSeconds">3600</attribute>
       <attribute name="maxAgeSeconds">3600</attribute>
       </region>
       <region name="/LicenseImpl">
       <attribute name="maxNodes">20</attribute>
       <attribute name="timeToLiveSeconds">3600</attribute>
       <attribute name="maxAgeSeconds">3600</attribute>
       </region>
       <region name="/CompanyImpl.licenses">
       <attribute name="maxNodes">5</attribute>
       <attribute name="timeToLiveSeconds">3600</attribute>
       <attribute name="maxAgeSeconds">3600</attribute>
       </region>
       <region name="/LicenseImpl.accounts">
       <attribute name="maxNodes">100</attribute>
       <attribute name="timeToLiveSeconds">300</attribute>
       <attribute name="maxAgeSeconds">300</attribute>
       </region>
       <region name="/AccountImpl">
       <attribute name="maxNodes">1000</attribute>
       <attribute name="timeToLiveSeconds">300</attribute>
       <attribute name="maxAgeSeconds">300</attribute>
       </region>
       <region name="/AccountImpl.folderList">
       <attribute name="maxNodes">1</attribute>
       <attribute name="timeToLiveSeconds">300</attribute>
       <attribute name="maxAgeSeconds">300</attribute>
       </region>
       <region name="/AccountAccessPlanImpl">
       <attribute name="maxNodes">10</attribute>
       <attribute name="timeToLiveSeconds">300</attribute>
       <attribute name="maxAgeSeconds">3600</attribute>
       </region>
       <region name="/EncoderImpl">
       <attribute name="maxNodes">50</attribute>
       <attribute name="timeToLiveSeconds">30</attribute>
       <attribute name="maxAgeSeconds">300</attribute>
       </region>
       <region name="/FolderImpl">
       <attribute name="maxNodes">500</attribute>
       <attribute name="timeToLiveSeconds">30</attribute>
       <attribute name="maxAgeSeconds">300</attribute>
       </region>
       <region name="/AssetMasterImpl">
       <attribute name="maxNodes">1000</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/AssetMasterImpl.assets">
       <attribute name="maxNodes">25</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/AssetMasterImpl.encodingRequestImplList">
       <attribute name="maxNodes">25</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/AssetImpl">
       <attribute name="maxNodes">1000</attribute>
       <attribute name="timeToLiveSeconds">30</attribute>
       <attribute name="maxAgeSeconds">60</attribute>
       </region>
       <region name="/AccountAttributeImpl">
       <attribute name="maxNodes">1000</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/AssetMasterAttributeImpl">
       <attribute name="maxNodes">1000</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/AssetAttributeImpl">
       <attribute name="maxNodes">1000</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/AccountImpl.attributeList">
       <attribute name="maxNodes">30</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/AssetMasterImpl.attributeList">
       <attribute name="maxNodes">30</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       <region name="/AssetImpl.attributeList">
       <attribute name="maxNodes">30</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">30</attribute>
       </region>
       </config>
       </attribute>
       <!--<attribute name="FetchInMemoryState">true</attribute>-->
       <!-- <attribute name="CacheLoaderConfiguration">
       <config>
       <passivation>false</passivation>
       <preload>/some/stuff</preload>
       <cacheloader>
       <class>org.jboss.cache.loader.JDBCCacheLoader</class>
       same as the old CacheLoaderConfig attribute
       <properties>
       cache.jdbc.table.name=jbosscache
       cache.jdbc.table.create=true
       cache.jdbc.table.drop=true
       cache.jdbc.table.primarykey=jbosscache_pk
       cache.jdbc.fqn.column=fqn
       cache.jdbc.fqn.type=varchar(255)
       cache.jdbc.node.column=node
       cache.jdbc.node.type=bytea
       cache.jdbc.parent.column=parent
       cache.jdbc.parent.type=varchar(255)
       cache.jdbc.datasource=java:/treeCacheDS
       cache.jdbc.driver=oracle.jdbc.OracleDriver
       cache.jdbc.url=jdbc:oracle:thin:@localhost:1521:JBOSSDB
       cache.jdbc.user=SCOTT
       cache.jdbc.password=TIGER
       </properties>
      
       whether the cache loader writes are asynchronous
       There is always the possibility of dirty reads since all writes are performed asynchronously,
       and it is thus impossible to guarantee when (and even if) a write succeeds
      
       <async>false</async>
       only one cache loader in the chain may set fetchPersistentState to true.
       An exception is thrown if more than one cache loader sets this to true.
       <fetchPersistentState>true</fetchPersistentState>
      
       determines whether this cache loader ignores writes - defaults to false.
       <ignoreModifications>false</ignoreModifications>
       </cacheloader>
       </config>
       </attribute>-->
       </mbean>
      </server>
      


      Thanks in advance,
      Bhakta