[ 
http://issues.apache.org/jira/browse/XALANJ-2168?page=comments#action_12315502 
] 

Glenn Crilley commented on XALANJ-2168:
---------------------------------------

A fix to source module ElemCopyOf.java in the org.apache.xalan.templates 
package. After line 186 add the following line:

xctxt.release(dtm, true);

Apply this fix appears to have corrected the memory leak.  We will be 
performing other tests to verify the fix and to ensure nothing else has been 
broken.


update block of code is shown below:


           while (DTM.NULL != (pos = nl.nextNode()))
          {
            DTM dtm = xctxt.getDTMManager().getDTM(pos);
            short t = dtm.getNodeType(pos);

            // If we just copy the whole document, a startDoc and endDoc get
            // generated, so we need to only walk the child nodes.
            if (t == DTM.DOCUMENT_NODE)
            {
              for (int child = dtm.getFirstChild(pos); child != DTM.NULL;
                   child = dtm.getNextSibling(child))
              {
                tw.traverse(child);
              }
            }
            else if (t == DTM.ATTRIBUTE_NODE)
            {
              SerializerUtils.addAttribute(handler, pos);
            }
            else
            {
              tw.traverse(pos);
            }
            xctxt.release(dtm, true); // This is the code fix
            }
          }

> Memory Leak using xalan with Java extension
> -------------------------------------------
>
>          Key: XALANJ-2168
>          URL: http://issues.apache.org/jira/browse/XALANJ-2168
>      Project: XalanJ2
>         Type: Bug
>   Components: Xalan-extensions-(SQL)
>     Versions: 2.6
>  Environment: Windows XP and Unix
>     Reporter: Glenn Crilley
>     Priority: Blocker

>
> Performing an XSL translation using the xalan paerser with an java-based 
> extension causes memory leake

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to