On 17/09/2014 20:55, Christopher Schultz wrote:
> All,
> 
> I'm running Tomcat 8.0.9 on Mac OS X under Oracle's Java 7 jdk1.7.0_65.
> 
> For a long time, I've had a cleanly reloading web application, meaning
> that after my web application is reloaded (say, during development),
> the old WebappClassLoader is available for GC.
> 
> After switching to Tomcat 8.x in my development environment, I've
> noticed that I can't cleanly reload anymore. Using YourKit, I've
> traced the reference to my WebappClassLoader to DBCP2.
> 
> I have a JNDI DataSource whose JDBC driver is loaded from Tomcat's
> CATALINA_HOME/lib directory.

Where is the connection pool defined? In the Context or globally?

> It seems that org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool has
> a member, factoryClassLoader, which points to my WebappClassLoader. I
> believe that it will likely retain that reference after multiple
> reloads, so I'm only leaking a single WebappClassLoader.

I think that will be a problem for global DataSource instances. I'd need
to review what the field was doing to figure out the correct fix.

Mark


> 
> I think we probably want to use the ClassLoader of the JDBC driver for
> the DBCP pool as well. Can anyone confirm that this happens to them as
> well?
> 
> Thanks,
> -chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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

Reply via email to