Bug #20003 | Connector kills Memory | ||
---|---|---|---|
Submitted: | 22 May 2006 16:48 | Modified: | 23 May 2006 12:30 |
Reporter: | Theo Nietzschmann | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | mysql-connector-java-3.1.12-bin.jar | OS: | Windows (XP) |
Assigned to: | CPU Architecture: | Any |
[22 May 2006 16:48]
Theo Nietzschmann
[22 May 2006 17:19]
Mark Matthews
Where do you close your statements and result sets? If you don't do this explicitly, they will be closed for you when the "parent" object that created them is closed (as per the JDBC spec). Earlier versions of the driver didn't maintain references to these open statements and result sets (as is required by the JDBC spec), so they would be eligible for GC as soon as your application was done with them. The latest versions of the driver _are_ required to maintain these references, and will appear to leak memory for applications that do not follow the requirement in the JDBC spec that applications are responsible for calling _close()_ on resources they no longer are using. Are you sure that you actually call .close() on all result set and statement instances? Does adding "dontTrackOpenResources=true" to your JDBC URL configuration properties change the problem you see? If so, your application is "leaking" either result sets or statements, which is something you need to fix.
[22 May 2006 17:49]
Theo Nietzschmann
thx for quick reply you are right, ResultSet.close() will fix.