1 Reply Latest reply on Jan 19, 2006 9:30 AM by adrian.brock

    Memor Leak Problem with IdleRemover Thread

    abhisark

      I am using JBoss 4.0.3 sp1.
      Configured no-tx-datasource (oracle-ds.xml): The contents of which are


      <no-tx-datasource>
      <jndi-name>jdbc/IMDB</jndi-name>
      <connection-url>jdbc:oracle:thin:@linux41.dev.somedomain.com:1521:imdbutf8</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>someusr</user-name>
      someusr
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <min-pool-size>10</min-pool-size>
      <max-pool-size>100</max-pool-size>
      <blocking-timeout-millis>5000</blocking-timeout-millis>
      <idle-timeout-minutes>10</idle-timeout-minutes>
      <check-valid-connection-sql>select count(*) from users</check-valid-connection-sql>
      </no-tx-datasource>


      I am using this data-source from within my webapp. When I undeploy the webapp, I am having a memory leak w.r.t. org.jboss.resource.connectionmanager.IdleRemover thread. Its holding a reference to the WebAppClassLoader and hence the WebAppClassLoader is not getting garbage collected.
      This is how the reference is:
      java.lang.Thread [JNI Global, Stack Local] (This is the idle remover thread)

      inheritedAccessControlContext java.security.AccessControlContext

      -> context java.security.ProtectionDomain[10]

      -> [3] java.security.ProtectionDomain

      -> classloader org.jboss.web.tomcat.tc5.WebAppClassLoader

      Looks like the IdleRemover thread is getting spawned within the context of the webapp. Also its having inheritedAccessControlContext for 10 java.security.ProtectionDomain objects, out of which one is holding a reference to the webapp classloader.

      If I change the idle-timeout to be 0, the thread never starts and my webapp classloader gets Gc'd propertly.

      Any hints, clues or suggestion will be of great help. Am I configuring the data-source incorrectly?