Josip Maslać - 2013-04-27

I'm not sure whether there is a problem in your code, but I had similar problems with outofmem exceptions when loop-ing and using tons of data. I fixed that by, whenever it was possible enclosing everything in <empty> blocks and using <template> instead of <var>.

For example I had something like:

<var-def name="listOfParsedUrls">
    <loop item="url" filter="unique" maxloops="2">
        <list><var name="urls"/></list>
        <body>
            <var name="url"/>
        </body>
    </loop>
</var>

(It was more complicated then that but that's enough for this example.)

Constructs like this used tons of memory cause every <var> internally created variables much bigger then I needed (of type XmlNodeVariable).

I've changed that to something like this:

<var-def name="listOfParsedUrls"/>
<loop item="url" filter="unique" maxloops="2">
    <list><var name="urls"/></list>
    <body>
        <empty>
            <var-def name="listOfParsedUrls">
                <template>${listOfParsedUrls}</template>
                <template>${url}</template>
            </var-def>
        </empty>
    </body>
</loop>

Memory usage dropped 4-5x.

Hope this helps you.

 

Last edit: Josip Maslać 2013-04-27