2012/3/28 Osipov, Michael <michael.osi...@siemens.com>:
> Hi folks,
>
> Recently this started to pop up in my logs:
> 23.03.2012 14:12:28 org.apache.catalina.loader.WebappClassLoader 
> clearReferencesThreads
> SCHWERWIEGEND: The web application [/ket] appears to have started a thread 
> named [PoolCleaner[18291494:1332172047553]] but has failed to stop it. This 
> is very likely to create a memory leak.
>
> There is some similar thread [1] which had no real result.
>
> I am on Tomcat 6.0.35, all DataSources are created in the context.xml file. 
> All DataSources are cleaned up (closed) with a context.xml Listener. The JDBC 
> Pool is version 7.0.26.
>
> As far as my debug sessions have revealed (with attached VisualVM), it does 
> not matter how many apps you deploy the PoolCleanTimer thread is created only 
> once and retained until all apps have been stopped or removed. This makes 
> Tomcat think that this is a memory leak.
>
> Is there a way to associate this thread with another class loader in order to 
> avoid this problem or create multiple threads or simple ignore this warning 
> which is not a solution for those who face that issue too?

Is there a way to start it before webapps are started?

Something similar exists in the following listener:

<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"
/>

At Tomcat startup it calls different API methods that are known to
create such classloader-bound objects.

> Is there a way to associate this thread with another class loader

Thread.setContextClassLoader() ? But IIRC this method is not thread-safe.


> Besides that, the numbers in the thread name are not very informative, the 
> classloader hashcode and timestamp did not really help to to identify 
> anything. Can this be improved?

What would you like to see there? Thread names are not under our
control. Anything else that can be obtained through API calls can be
added.

Suggestions are welcome. See the code -- search for
"webappClassLoader.warnThread"
in org/apache/catalina/loader/WebappClassLoader.java

>
> [1] http://www.mail-archive.com/users@tomcat.apache.org/msg87350.html
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to