Question
Out of Memory Problem
I have a code I use for processing a large quantity of image files. Each image file is 1600 x 1200 ASCII, about 10 MB. I read each file inside a for loop using READFILE and process it with an end result that's a 400 element vector. I then read in the next file, etc. I was very careful in constructing the code to use function calls so that memory wouldn't be occupied needlessly. My code never has more than 2 image files in memory at any one time. Nevertheless, if I try to process more than about 40 files the code terminates with a "not enough memory" issue. This seems strange both because I shouldn't be taking up memory unnecessarily, but also because when I've observed the memory usage using the Task Manager on my computer, it appears that over time the amount of memory being consumed by MathCAD just slowly creeps up until the program crashes. And according to the Task manager, this is occurring even though I'm using less than 2 GB of RAM (I have 4 GB).
Is there a bug in the way MathCAD allocates and releases memory? Are there any decent workarounds?
Is there a bug in the way MathCAD allocates and releases memory? Are there any decent workarounds?

