Java heap space error when creating a long XML element through appendChild
--------------------------------------------------------------------------

                 Key: MASHUP-907
                 URL: https://wso2.org/jira/browse/MASHUP-907
             Project: WSO2 Mashup Server
          Issue Type: Bug
            Reporter: Jonathan Marsh
            Assignee: Channa Gunawardena


Can we run a memory profiler on the following mashup?

testXMLText.outputType = "#raw";
function testXMLText() {
    var output = "<test>";
    for (var i=0; i<2000; i++) {
        output += "<number>" + i + "</number>";
    }
    output += "</test>";
    return new XML(output);
}

testXML.outputType = "#raw";
function testXML() {
    var output = <test/>;
    for (var i=0; i<2000; i++) {
        output.appendChild(<number>{i}</number>);
    }
    return output;
}

Intuitively, I would expect the memory requirements of the first function to be 
greater (requires both a string representation, and an XML object 
representation, of the XML document to be held in memory.)  Instead, the latter 
chugs for a while and then generates java.lang.OutOfMemoryError: Java heap 
space.  First function works fine and speedily.

Could it be that the appendChild method is leaking?

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

        

_______________________________________________
Mashup-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to