Trying to understand this memory leak (root is jboss ConnectionValidator)

185 views
Skip to first unread message

Olivier Masseau

unread,
Jul 25, 2023, 1:40:00 PM7/25/23
to WildFly
Hello,

We've got some memory leak where thousands of instances of oracle.jdbc.driver.T4CPreparedStatement are kept in memory, taking 3gb of RAM.

I can't really understand if it is a problem with Oracle JDBC driver or a problem with the jboss ConnectionValidator :

Here is the computed merged GC roots done in VisualVM after opening the heap dump :


2023-07-25 19 31 06.png

The app is running on WF 23.

Is there any know memory leak in the connection validator keeping references to prepared statements ?

Thanks a lot for your help.

Olivier Masseau

unread,
Jul 25, 2023, 1:51:27 PM7/25/23
to WildFly
Something else reported by jxray (but not VisualVM, I don't know why) :

2023-07-25 19 50 12.png

Olivier Masseau

unread,
Jul 26, 2023, 3:47:25 AM7/26/23
to WildFly
Something I've noticed by looking deeper at the heap dump :

I have 158 instances of PreparedStatementCache !
How is this possible for a single datasource ?

Each PrepaparedStatementCache instance references up to100 prepared statement, which corresponds to what is defined for the datasource :

                    <statement>
                        <track-statements>true</track-statements>
                        <prepared-statement-cache-size>100</prepared-statement-cache-size>
                        <share-prepared-statements>true</share-prepared-statements>
                    </statement>

So 158*100 = 15 800 possible instances of prepared statements which correlates with the the 14894 instances of T4CPreparedStatement I have in my heap.

So it seems something is wrong with the prepared statement cache which is duplicated.

frank.l...@outlook.de

unread,
Jul 26, 2023, 7:10:42 AM7/26/23
to WildFly
How many database connections do you have ?
Reply all
Reply to author
Forward
0 new messages