Re: [xsl] "Heap" of trouble handling input file of 500 MByte

Subject: Re: [xsl] "Heap" of trouble handling input file of 500 MByte
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 21 Feb 2011 13:45:24 +0100
On 19-2-2011 20:47, thehulk@xxxxxxxxxxx wrote:
Is it really a lack of heap space? I imagine that heap requirements are proportional to file size, but then a 3 GByte VM should work.

You wrote that you have a 32 bit Windows XP machine. Addressing more than 2GB in a single program without it being compiled with the /LARGEADDRESSAWARE flag is not possible (see http://msdn.microsoft.com/en-us/library/aa366778%28v=vs.85%29.aspx). And Java (the host program) is not compiled that way iirc.


Note that even if that flag is set, that if the program requires a consecutive block of memory, chances are the maximum usable memory of available memory is signifantly less due to memory segmentation.

Could the problem relate to the XSL code itself, which is very brief and does a sort-while-copying operation?

No, it is more likely that the 500MB source file is the problem. Depending on the processor and the XML parser, this is roughly between 3.5 and 4.5 times the size of XML is needed in-memory (unless you can use streaming-XML/XSLT).


One solution could be is running your transformation on a 64 bit platform. But be aware of possible other issues that may rise (not all programs are designed with an agnostic integer-size in mind).

Kind regards,
Abel

Current Thread