It's ironic that I just found a similar problem in MATLAB. The problem there seems to be that garbage collection is the responsibility of Java, and Java would not schedule a garbage collection unless I forced a change in focus in the MATLAB environment. So I wrapped my code to the function calls that do the processing in a while loop that made a function call and then looped, alternately checking free memory and issuing commands to change the UI focus, until /free/ memory went above 2GB (for me). It works, though it is barely defensible, and I am not a Java programmer.
I don't know how to do the equivalent in Mathcad except maybe to click on different items in the UI as your code is executing.
...and, yes, if this is a problem in Mathcad, then it needs to be fixed here, too.
Rich
http://www.downeastengineering.com/