I am working on generating some correlated sequences using Matrix Exponential techniques. there seems to be some problem with the way maple manages memory (or am i doing something wrong?). specifically, in the code below, i am calling a few functions inside a for loop but none recursively. so as the for loop progresses my stack (memory; seen as PF Usage in win XP) size should not really blow up. right? but in Maple 9.0 and 10.0 this below program would give a "Execution stopped: stack limit reached." exception after about 30000 executions(I am running on a WinXP machine , about 2.8GHz, with 512 MB RAM, also checked on a machine with 1 GB Ram; and another 1GB in page file size). But the same program seems to work alright on the same machines with Maple8 running (i uninstalled maple-9 and installed maple-8 in one case). I could go up to 300,000 iterations without any problem. And the memory would go from about 250MB (PF Usage) to about 800MB. So even in Maple 8 there is some stuff that is being dumped on the stack; i tried to run Garbage collector (gc()) function once every 500 iterations; it did not make any difference either. Can anyone please look into it?