[Mashup-dev] [jira] Updated: (MASHUP-907) Java heap space error when creating a long XML element through appendChild

Keith Godwin Chapman (JIRA) jira at wso2.org
Thu Mar 26 23:06:28 PDT 2009


     [ https://wso2.org/jira/browse/MASHUP-907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Keith Godwin Chapman updated MASHUP-907:
----------------------------------------

    Fix Version/s: 2.0
                       (was: 1.6)

> 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: Keith Godwin Chapman
>             Fix For: 2.0
>
>
> 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

        



More information about the Mashup-dev mailing list