memory saturating with a repeat loop

Andre.Bisseret Andre.Bisseret at inria.fr
Fri Aug 21 12:19:54 EDT 2009


Bonjour,

I have an app including about five  hundred stacks (main stacks with  
substacks); they are physician's clients files.
In order to produce statistics I have a handler which search the  
values of several measures in the main stack and one substack of each  
clients.

I am using a repeat loop to search the stacks (useful to say that, as  
soon as the values are picked up, I "delete" the main stack).

Despite this, my app systematically crashes before completing the all  
set of stacks.

In the archives of the list, I found the following :
---------------------------------------
Re: Releasing Memory and Virtual Memory

J. Landman Gay
Tue, 11 Aug 2009 15:27:28 -0700

BNig wrote:

     Derek,
     do you import the 100 or so images in a repeat loop?
     If so try whether adding a wait 2 milliseconds in the repeat loop  
helps.
     Or alternatively try to do it in a "send" structure. In my  
experience Rev
     has problems releasing memory in a repeat loop. When I changed to  
a "send to
     me in 2 milliseconds" no more problem with memory build-up.

I agree, and I'm pretty sure this must be what's wrong. Rev doesn't do  
any garbage collection until a handler ends. The most reliable way is  
the "send in <time>" structure.
--
Jacqueline Landman Gay         |     jac... at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com
-----------------------------------------

But after a lot of unsuccessful trials I am completely lost and seem  
unable to think correctly anymore!

including "wait 2 milliseconds" in the repeat loop does not help.

I don"t see how I could avoid the repeat loop ? (how to use a "send in  
time" structure ? is it instead of the repeat loop ??)
I tried to proceed one hundred stacks at a time only, but here again I  
don"t see how to avoid a repeat loop ?

What am I missing ?

Thanks a lot in advance for any advice

Best regards from Grenoble
André




More information about the use-livecode mailing list