Memory leak from DTMManager
---------------------------

         Key: XALANJ-1999
         URL: http://nagoya.apache.org/jira/browse/XALANJ-1999
     Project: XalanJ2
        Type: Bug
  Components: DTM  
    Versions: 2.6    
    Reporter: Morris Kwan
 Assigned to: Morris Kwan 


Similar to bug 1844, this problem also became
evident after the introduction of XMLReaderManager. The leak
described by 1844 is an incremental leak, where the leaked memory
increases over time, eventually resulting in an out-of-memory error.
The leak here is less serious. Only one DTM is leaked per thread. In
most cases it is unlikely to cause an out-of-memory error. 

The problem:
XMLReaderManager maintains a pool of XMLReaders and tries to reuse
them across transformations. An XMLReader has references to the DTM
objects because we call the XMLReader.setContentHandler/setDTDHandler/
setErrorHandler methods in DTMManagerDefault. The references are not
released after the tranformation is done. Therefore an active XMLReader
always has reference to the last DTM it created. In multi-thread
scenarios, we might use multiple XMLReaders, where each thread leaks its
own DTM, adding up to a bigger total leak.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to