A couple of pointers.

Are all variables impliclty declared. (no variants)

Are you cleaning out objects when you are done with them?

Out of stack space suggests a problem with a recursive fucnction of some sort.

As for speed etc, only you can do that. Without seeing the code we can't tell you how to optomise it.


Regards.