I have written a program in Maple 2016 (Windows 7) made of two parts :
- An initialization step where a formal system of algebraic equations (some non linear) is built
Let S(U, P) this system, where U denotes a set of unknowns and P a set of parameters (see step 2 below)
- An iterative step where this system is solved with respect to U for different values of parameters P
This loop has to be executed N times for values P1, ..., Pn, ... of P
I observe that the size of the memory (bottom right of the Maple window) inflates as the value of n increases.
I was able to isolate in the loop corresponding to step 2, the procedure MyProc I wrote which is responsible of this memory inflation.
Now I would like to manage this inflation (typically the memory size grows up to 3 GiB for n about one thousand) because of its very negative effects on the computational time (probably Maple does spend a lot of time in swapping operations).
Suspecting the remember process to be the source of this problem, I tried simple tricks such as
- systematically write > quantity := 'quantity'; for fome intermediate quantities
- use forget : for example MyProc contains a call to fsolve and, after "local" declarations, I inserted the command forget(fsolve)
- in the the loop over n, I even inserted the command forget(Myproc).
None of these tricks was to some extent efficient to contain the memory inflation.
I suppose it is a very common situation that people who use to develop code are familiar with. So maybe some of you could provide my some advices or move me towards "strategies" or "methodologies" to prevent this situation ?
My purpose here is not to ask you to solve my problem, but rather to ask youy to give me hints to be able to manage such kind of situations by myself.
Maybe this question is unorthodox and doesn't have its place here ?
It that case please let me know.
Thanks In Advance
PS : it would be very difficult for me to provide you the code : if it is a necessary condition for you to help me, just forget it, I will understand