Hi, (moving to developers list) any ideas on the problem below? This thing is kind of itching me :-)
So I instrumented the "StatementFinalizer" class with some logging and learned that over time a few instances of the "StatementFinalizer" are created, used and destroyed. So far so good. For most of those instances, the overall number of statements that are added to the "statements" list by "createStatement" and the number of statements removed from the list by "closeInvoked" is identical and after "closeInvoked" finishes, the list is empty. But only for most instances of "StatementFinalizer". I could find that there is one instance that is used (statements are added), but the invocation of "closednvoked" stops after some minutes into the application. As a result the "statements" list starts growing. Rings any bells? Thanks Martin On Wed, Jul 11, 2018 at 4:22 PM, Martin Knoblauch <kn...@knobisoft.de> wrote: > Hi, > > while analyzing some heap dump for other reasons, I found that our > application is apparently aggregating a considerable amount of memory in > "org.apache.tomcat.jdbc.pool.TrapException", which is never cleaned by > GC. Digging deeper, it seems that the entries of the "statements" linked > list in the StatementFinalizer are never removed from the list, so after > three weeks of lifetime one ends up with a list of 7 million entries, each > 80 bytes. > > Now it might be, that we are just using the StatementFinalizer in a wrong > manner. And what we see is expected behavior. Below is our pool > configuration. Maybe something is just missing :-) > > We are at Tomcat 8.0.36 (yeah, I know, but that is the version we have to > use) and Java 8 (1.8.0_171). Underlying DB is Oracle 12.1.0.2 and we are > using the latest "ojdbc7.jar" from Oracle. > > > <Resource > name="jdbc/SimManagerDS" > auth="Container" > > type="javax.sql.DataSource" > description="Oracle datasource for xxxxxxx using > tomcat.jdbc.pool" > factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" > jmxEnabled="true" > jdbcInterceptors="ConnectionState;StatementFinalizer; > ResetAbandonedTimer;StatementCache(prepared=true,max=200)" > > initialSize="7" > minIdle="7" > maxActive="30" > maxIdle="10" > > testWhileIdle="true" > testOnBorrow="true" > testOnConnect="false" > testOnReturn="false" > validationQuery="SELECT 1 from dual" > validationInterval="30000" > > logAbandoned="true" > removeAbandoned="false" > removeAbandonedTimeout="0" > suspectTimeout="600" > > timeBetweenEvictionRunsMillis="30000" > minEvictableIdleTimeMillis="60000" > maxWait="60000" > maxAge="0" > > connectionProperties="(defaultRowPrefetch=200)" > > driverClassName="oracle.jdbc.OracleDriver" > url="jdbc:oracle:thin:@s#######" > username="########" > password="########" > /> > > Thanks > Martin > -- > ------------------------------------------------------ > Martin Knoblauch > email: k n o b i AT knobisoft DOT de > www: http://www.knobisoft.de > -- ------------------------------------------------------ Martin Knoblauch email: k n o b i AT knobisoft DOT de www: http://www.knobisoft.de