-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Mark,
On 9/23/14 10:18 AM, Christopher Schultz wrote: > Mark, > > On 9/23/14 5:52 AM, Mark Thomas wrote: >> On 22/09/2014 13:50, Christopher Schultz wrote: >>> Mark, >>> >>> On 9/17/14 4:06 PM, Christopher Schultz wrote: >>>> Mark, >>> >>>> On 9/17/14 4:02 PM, Mark Thomas wrote: >>>>> 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? >>> >>>> <Resource> is defined in my webapp's context.xml. >>> >>> Bump. > >> I hadn't forgotten this. > >> Looking into this has certainly been a good refresher for JDBC >> driver related memory leaks. > >> For the benefit of the archives: - make sure you are using the >> latest mysql driver > > The latest MySQL driver is actually worse than the older ones. > I've been fighting a battle with those folks to do take proper care > of ClassLoader issues. > >> - you'll need to add "com.mysql.jdbc.NonRegisteringDriver" to the >> JreMemoryLeakPreventionListener's classesToInitialize set > > I believe this is a bad solution, but the best one given the MySQL > driver's poor ClassLoader handling. I am aware that the driver > itself pins the WebappClassLoader and I have a patch for it. The > (Tomcat) pool is still holding onto the ClassLoader, too, though. > >> Also, right now, you'll need to add closeMethod="close" to the >> <Resource.../> definition for the DataSource. This shouldn't be >> necessary and I am in the process of fixing this for the next >> 8.0.x release. > > Okay, I'll check out adding the "closeMethod". Adding the closeMethod="close" seems to remove the DBCP reference to the ClassLoader. Excellent. Thanks, - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUIZu4AAoJEBzwKT+lPKRYxpAQAIqX/Zud0VtpfJdjq37HVIX7 h2VbYyFUQwf0m4DZBdkG2rst6NiXROkeUOHAYnxG8XTG/TqaBiFvULt2yhwNUuFk uWkYv/uyTPg1omUXMtet5o9ea/1St3TBeJPnC8jgZ3+jOBMIzxM0bQXhkWwPspZ/ A1Ij6JGcTChHA9X0qfD9bQw+mP9qV/zqWdY1nMXeFeBgB8wDgbGAK00Mdkn4O9jt Vm5Fk/JUzye7LAAQzgLfDP0FjXinq0mnj0mjVt17UkYcDR9ZuxZt/pZJ7hnyR83Y 7Ani8cYrqE/vdYbXTCp+gpmVsmdpQdZ83//HjFtB1e/lgUxkgXhR7IxUVyc57CUl 8h+iD8kYno0QOw8u5Oklm2wFdPQkvsaoO3U7gITmdJSFyG1aNU+ewDCs/XHwGItK FQFZdJlWuI6P7NgLsQTCR8JSR7mbBi4biTtxtleifGqYSTIFsMDpdmVb6cVzzVMe dBUNRqWt91e5D+d5xAlErstDL5nVWgLu60BC2od1q/YzylcNs+OXjcaj4vdeRxVx QVdDeJxcgW54ZZ8dDkzcvRdfE+1VzFoEdbBPzMB4dkxGoH4D2de5w6O8ErvCgoog WT/DjZYlEPUMLh8uUkOZ1pwuzBCV9V29Nuwbe+MX7dEzxPNScT1R6fd+ZFvDvNsO kdAa1owo470hbtd9APdO =KjE+ -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org