1 Reply Latest reply on Jan 19, 2006 9:30 AM by Adrian Brock

    Memor Leak Problem with IdleRemover Thread

    Abhisar Kothari Newbie

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

      <check-valid-connection-sql>select count(*) from users</check-valid-connection-sql>

      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?