<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">The driver of my algorithm looks like this:<br><br>foldl' processfn nullarray (take arg infinitelist)<br><br>where processfn takes an array and the next set of inputs,<br>processes, and delivers a new updated array (using the<br>Data.Vector library).<br>&nbsp;<br>Apparently, I have a space leak ... the "maximum residency"<br>varies linearly with the size of "arg" supplied, garbage<br>collection consumes ~75% of CPU time, and, if the arg is too<br>big, the whole thing crashes with an out of memory<br>error.&nbsp; The algorithm should operate in constant<br>space.<br><br>As you can see, I'm using a strict left-fold and also have<br>made the accumulating array strict in the processfn<br>definition with a bang pattern.&nbsp; So, I'm sort of at a<br>loss as to how to resolve this.<br><br>The help provided on this list has been outstanding, thanks<br>to all of you;
 hope you have something left in the tank for<br>this one!<br> </td></tr></table><br>