-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 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". Thanks, - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUIYEiAAoJEBzwKT+lPKRYwssQAITKQ4trZXBdAbCLuAvvSh6E 8a4ruDc3zIYz/Tlq9PEhcvtft5ga6x1+CBJp1tlmJ7Mf8DfJhdMhlTAyQA0PYZM+ kCvG/ApeTFH+jVlk5eWhZgP44D3tUWoT7K5zFOaVjc1j6/Mc7pG5iKIuDtME+ld+ 8vVFoM2g6PhTnAmUUUUwq55HrXBlPZf6eLnkzw7WldMP6JnaAieU3mDUAzLO0osK s22FbFpTJiRzjH6HGdb1ns7fdE4LBqqZlH+1gE0L6t55hwzDiKtceokyibsdhD9y M1RkTrWjCuD1XXXHnvhj6xONjFslw3jYGsPBMeCiMv4nUj5256DU5thnD5KfPPd1 M30t6btvcviqPmkDcGL++aaJqkQ1YeKOVVv8qcWBh43+7if21SnlHcQJidTbNkY/ L2I3+Hk5vSK/ivB98VJk8CtnoPoI4GUJB9/M5GqBIBokClbWijfSOA3/NAgyicl3 pKlXayMiNy9d4jOjNI3ryHjZYJMIlrqtXER5aDXhUvaogePSPKNG/RgS/W9HzinU ZqtETHH7xuR9MosHykDOEnjSCPcJ+n/R3Aw3cyrAYjFDxRh0268Lqhp3RCuAS0r3 TtBLHTQug6s0/jgoBvx+Tj63+NSJd3npHr+2JcMrzSDPLVPBFjd3mPYkKYdsxtCa z3izg0tlgnuqQ9WnUvMs =XsRS -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org