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 2004/06/02 18:25:35 UTC

DO NOT REPLY [Bug 29057] - Used memory is not released once OutOfMemoryError occurs when DTMManager.setIncremental() is set as true.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29057>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29057

Used memory is not released once OutOfMemoryError occurs when DTMManager.setIncremental() is set as true.

igorh@ca.ibm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|xalan-dev@xml.apache.org    |igorh@ca.ibm.com



------- Additional Comments From igorh@ca.ibm.com  2004-06-02 16:25 -------
The problem seems to be relatively complicated.
Setting 
DTMManager.setIncremental(true);
causes creating a new (second)thread.
OutOfMemory exception happens in the main thread.
The second thread doesn’t know anything about the
exception and waits indefinitely. This thread wouldn’t be
terminated while the JVM is alive.

There is relatively simple  solution for this particular bug
to change methods in TransformerHandlerImpl 

if (m_contentHandler != null){
      if(!needErrorFlag){
try{
        m_contentHandler.characters(ch, start, length);
      } catch (Throwable t) {
        m_contentHandler.endDocument();
        throw new SAXParseException(t.getMessage(),m_locator);
     }
	}else{
		m_contentHandler.characters(ch, start, length);	
	}
 }


It would work with some performance degradation.

This solution seems to be not that complete. 
As far as I understand we had some code to handle the problem
(see TransformerImpl hasTransformThreadErrorCatcher(), 
getExceptionThrown()).

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org