-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Cris,
On 9/20/16 12:06 PM, Berneburg, Cris J. - US wrote: > Around 9/6/16 Chris Schultz replied to the "WAR isolation > lifecycle" thread with: > >> There are some libraries that don't shut down well, or the >> applications that use them don't properly shut them down. The >> solution is to either fix the library (ask them!), or use >> Tomcat's "leak prevention listener" to pre-load those classes >> that represent a problem. >> >> http://tomcat.apache.org/tomcat-8.0-doc/config/listeners.html#JRE_Mem ory_Leak_Prevention_Listener_-_org.apache.catalina.core.JreMemoryLeakPre ventionListener >> >> >> You want to read about the "classesToInitialize" attribute. > > Having recently dealt with some memory leaks, I was curious and > read through. Great! This might help in future struggles. > However, being still somewhat new to this, I was unable to > determine how to invoke the classesToInitialize parameter inside > the server.xml from the documentation page. Googling around led to > this: > > http://stackoverflow.com/questions/11872316/tomcat-guice-jdbc-memory-l eak#19027873 > > The critical part is: > >> In tomcat/conf/server.xml, modify (inside the Server element): >> <Listener >> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" >> /> >> >> to >> >> <Listener >> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" >> >> classesToInitialize="com.mysql.jdbc.NonRegisteringDriver" /> > > Aha, that's the XML syntax! Why didn't I know that? > > So, could we add a small example server.xml snippet to the > JreMemoryLeakPreventionListener documentation to make it clear to > newbies how to add the classesToInitialize option? Something > like: > > <Listener > className="org.apache.catalina.core.JreMemoryLeakPreventionListener" > > classesToInitialize="oracle.jdbc.driver.OracleTimeoutThreadPerVM" /> Care to make a formal documentation patch? You'll get your name in the changelog :) > Is this also valid? > > <Listener > className="org.apache.catalina.core.JreMemoryLeakPreventionListener"> > > <classesToInitialize>oracle.jdbc.driver.OracleTimeoutThreadPerVM</classe sToInitialize> > </Listener> I'm not sure but I don't think so. It all depends upon how Tomcat has configured the digester, since it treats child elements and element attributes differently. > Would examples look better after the Attribute/Description table as > a separate section or embedded directly within the table? Definitely outside of the table IMO. - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJX4YDLAAoJEBzwKT+lPKRYU2EQAJK9n62A3aDELeDU8ORMJCKy GiaUtIOz+aGgf2dzBLFaMGG07mgNr+qhIHHt0/XU0MYnlAL5++bEGuJ+E+gjiLNs LIOXD3W0C5ocsTNV7bl0GRxbHHqioyWo5x33LMa83R5FCIxfIfEpCCKtJ+xEoymi ZzFBuZL3Cb7mSFfZrs0VzfOhemlA4UkK2cWxXoOd/nzIdsUOJnurcM8OZbP3BK28 HHTTwCAlVzcuFb/Tt88+o69KrLtwzPAOaRerGcebxs8E1sgAw05Amc7iLryXQUpn IJGpGOdtHfZ8btbNTfuCPCdfeqQ8rjD7Fh+2jNAoJe1L+1dvk1pqMuuJq1h4rT34 m2WbgcJhaQKm5NPD94j/12pmZLgz/pP+uYgXoBLNCyNKI2mCK1kMYevAweMIneCa JwD0p+MPqd2QXRmyihzJIaBNTeM2Jjp/HQH7qHxW7SkBBfskK50memFH89JsgUs7 /WjHIs1KvfvV+iigFsr8cqx/qHKRKxcgP3XnaQ4Hqu8CidiwD/1IMhpRGHSDDrkY hMCs8dtK15dCQ6YkuCHBFLTMJjpowiBjbJYKHUxx6zcLr5q3utQx1hy/nxiES6eA CeLPeUb/zVpuIsSwcNyZ4HOR+z1ymxmvlkNaNZBkWc1kW/6IKxkg4ptFqmyNTYG5 /Av7DhIUoGO4nGrTvmAv =aXo7 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org