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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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.

Reply via email to