You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using Eclipselink with recent versions of the mssql-jdbc driver is resulting in a memory leak.
This appears to be due to the fact that recent versions of the mssql-jdbc driver has had a reconnect listener added. The reconnect listener is added to the SQLServerConnection when a PreparedStatement is created and removed from the SQLServerConnection when the PreparedStatement is closed.
It appears however, that EclipseLink is not closing the PreparedStatement, resulting in a memory leak.
After upgrading to Java 17 and running a stress test, we found SQLServerConnections leaking GBs of heap due to having a lot of reconnect listeners.
It appears this is happening after a change in the mssql-jdbc driver, see microsoft/mssql-jdbc#2364.
To Reproduce
It appears the problem occurs when using EntityManager.persist(entity) and the transaction is commited.
Used versions:
EclipseLink 4.0.5
mssql-jdbc 12.10.0.jre11
Steps/resources to reproduce the behavior:
Please see the attached zip file, containing a sampple project and instructions to reproduce. demo.zip
Expected behavior
Memory usage should stagnate, not keep increasing until the application runs out of memory.
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
Using Eclipselink with recent versions of the mssql-jdbc driver is resulting in a memory leak.
This appears to be due to the fact that recent versions of the mssql-jdbc driver has had a reconnect listener added. The reconnect listener is added to the SQLServerConnection when a PreparedStatement is created and removed from the SQLServerConnection when the PreparedStatement is closed.
It appears however, that EclipseLink is not closing the PreparedStatement, resulting in a memory leak.
After upgrading to Java 17 and running a stress test, we found SQLServerConnections leaking GBs of heap due to having a lot of reconnect listeners.
It appears this is happening after a change in the mssql-jdbc driver, see microsoft/mssql-jdbc#2364.
To Reproduce
It appears the problem occurs when using EntityManager.persist(entity) and the transaction is commited.
Used versions:
Steps/resources to reproduce the behavior:
Please see the attached zip file, containing a sampple project and instructions to reproduce.
demo.zip
Expected behavior
Memory usage should stagnate, not keep increasing until the application runs out of memory.
Additional context
The text was updated successfully, but these errors were encountered: