You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/11/26 20:07:22 UTC
DO NOT REPLY [Bug 25029] New: -
Memory leak registering JDBC drivers.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25029>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25029
Memory leak registering JDBC drivers.
Summary: Memory leak registering JDBC drivers.
Product: XalanJ2
Version: 2.5
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: Other
Component: org.apache.xalan.lib.sql
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: CTDay@LBL.Gov
DefaultConnectionPool generates a memory leak by creating and registering a
Driver instance with the DriverManager each time the
DefaultConnectionPool.initializePool() method is called. Because
DefaultConnectionPool.m_IsActive defaults to "false", connections are not
actually pooled. In this case, initializePool() is called for _each_ connection
request.
DriverManager keeps a reference to each Driver instance, even when they
represent the same ClassLoader/Class. Hence, the Driver instances are never
garbage collected.
Fixup is to delete the line
"DriverManager.registerDriver(m_Driver);"
from DefaultConnectionPool.initializePool(), within the "try" clause.
This is only a fixup; the logic should be rethought. At least with JDK 1.4+,
DefaultConnectionPool should get connections directly from DriverManager and
let DriverManager do its job. More than that, this internal management of
XConnections seems to preclude using container-supplied versions of JDBC
connection pooling.