Tomcat 5 admin / configuration notes
Issue continously redepoloyer cause Out-of-Memory error
In a subversion post-commit auto-redeploy via Tomcat client deployer package. Tomcat have some memory leak syntom.
The following issues / record explain this clearly
Check connection leak with DBCP
<Context debug="1" reloadable="true" crossContext="true">
<Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"
username="root" password="" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/MY_DB?autoReconnect=true"
maxActive="30" maxIdle="10" maxWait="5000"
poolPreparedStatements="true"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
/>
</Context>Note:
removeAbandoned = the main option to turn on "remove abandoned connection"
The trigger for removing is Connectionm checkin/checkout I.e if you manually trigger a lot of connection leak at once, the connection will not be abandoned, you need to trigger a connection request after the 'timeout' period passed. Second condition is, number of Idle connection <2 and numActive < maxActive - 3
If curios, take a look at the source of BasicDataSource and AbandonedObjectPool
Also, this page: