When doing a hot redployment of seed application, it is not able to free the connections from the connection pool. Tomcat throws out of memory exception.
If the deployment is done first time it works fine as there are no existing connections that needs to be released.
Also if we shut down the tomcat instance, it releases the connections properly.
Default Hikari connection pool settings are used and no customization is done.
Adding logs:-
Oct 26, 2016 2:46:24 PM org.apache.catalina.startup.HostConfig deleteRedeployResources INFO: Undeploying context [/test-web-1.0.0] 2016-10-26 14:46:24,156?[0;39m ?[35mContainerBackgroundProcessor[StandardEngine[Catalina]]?[0;39m ?[36mo.s.s.w.l.Seed ServletContextListener?[0;39m - Stopping Seed Web application 2016-10-26 14:46:24,157?[0;39m ?[35mContainerBackgroundProcessor[StandardEngine[Catalina]]?[0;39m ?[36mo.s.j.i.JpaPlugin?[0;39m - Closing entity manager factory for persistence unit test-xxx 2016-10-26 14:46:24,158?[0;39m ?[35mContainerBackgroundProcessor[StandardEngine[Catalina]]?[0;39m ?[36mo.s.j.i.JdbcPlugin?[0;39m - Closing JDBC datasource test_ds 2016-10-26 14:46:24,159?[0;39m ?[35mContainerBackgroundProcessor[StandardEngine[Catalina]]?[0;39m ?[36mc.z.h.p.HikariPool?[0;39m - HikariCP pool HikariPool-0 is shutting down. 2016-10-26 14:46:24,228?[0;39m ?[35mContainerBackgroundProcessor[StandardEngine[Catalina]]?[0;39m ?[36mo.s.s.w.l.SeedServletContextListener?[0;39m - Seed Web application stopped ?[31m?[0;39mOct 26, 2016 2:46:24 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/test-web-1.0.0] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Oct 26, 2016 2:46:24 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/test-web-1.0.0] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Oct 26, 2016 2:46:25 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive F:\Eclipse-New-PSA\Eclipse_DEV\Serveurs\J2EE\tomcat\apache-tomcat-7\webapps\test-web-1.0.0.war
14:46:32,543 |-INFO in LoggerContext[default] - Could NOT find resource [logback.groovy] 14:46:32,543 |-INFO in LoggerContext[default] - Could NOT find resource [logback-test.xml] 14:46:32,543 |-INFO in LoggerContext[default] - Found resource [logback.xml] at [file:/E:/PSA-test/GL_SVN_TEST_ENV/test-conf/test-web/logback.xml] 14:46:32,606 |-INFO in joran.action.ConfigurationAction - debug attribute not set 14:46:32,739 |-INFO in LevelChangePropagator@425941ba - Propagating OFF level on Logger[org.reflections] onto the JUL framework .... .... 14:46:32,740 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Adding property to the context with key="bySecond" and value="20161026T144632" to the LOCAL steste 14:46:32,746 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [c:/temp/log//TestWeb-20161026T144632.log] 14:46:32,811 |-INFO in joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
?[34mINFO ?[0;39m ?[33m2016-10-26 14:46:35,062?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.s.s.w.l.SeedServletContextListener?[0;39m - Starting Seed Web application ?[31m?[0;39m?[31mWARN ?[0;39m ?[33m2016-10-26 14:46:42,623?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.h.e.HibernatePersistence?[0;39m - HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate. jpa.HibernatePersistenceProvider] instead. 2016-10-26 14:46:42,678?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.h.j.i.u.LogHelper?[0;39m - HHH000 204: Processing PersistenceUnitInfo [ name: test-xxx ...] 2016-10-26 14:46:42,801?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.h.Version?[0;39m - HHH000412: Hibernate Core {4.3.11.Final} 2016-10-26 14:46:42,808?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.h.c.Environment?[0;39m - HHH000206: hibernate.properties not found 2016-10-26 14:46:42,810?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.h.c.Environment?[0;39m - HHH000021: Bytecode provider name : javassist 2016-10-26 14:46:43,096?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.h.a.c.Version?[0;39m - HCANN000001: Hibernate Commons Annotations {4.0.5.Final} 2016-10-26 14:46:43,153?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mc.z.h.HikariDataSource?[0;39m - HikariCP pool HikariPool-0 is starting. 2016-10-26 14:46:43,417?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.h.d.Dialect?[0;39m - HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect 2016-10-26 14:46:43,908?[0;39m ?[35mlocalhost-startStop-2?[0;39m ?[36mo.h.h.i.a.ASTQueryTranslatorFactory?[0;39m - HHH000397: Using ASTQueryTranslatorFactory ?[31m?[0;39m