memory saturating with a repeat loop

BNig niggemann at uni-wh.de
Fri Aug 21 15:50:43 EDT 2009


Andre,
I ran into the same problem when analysing 3500 stacks distributed over 3
computers, over 1000 stacks on each. Rev crashed. In the repeat loop version
you could watch the memory go down in the activity monitor (on a Mac) and
once it went into virtual memory soon after it crashed.
Than I did a send in time version and it went smoothly and fast even though
it was over a local area network. 
I made a bug report as a minor bug #6631 which has a demo stack that shows
how repeatedly loading a stack and deleting it afterwards crashes
revolution. And there is the send in time version that avoids crashing.
Essentially it is like the code Richard has proposed.

Once you get the idea of send in time constructs they are a) easy to do and
b) keep you out of trouble because Revolution can do it's housekeeping while
you do your long and tedious computing.

It may be a design flaw to put that amount of data into that many individual
stacks but there were reasons for me to choose this approach. And with the
send in time approach all went well.

regards
Bernd 


Andre.Bisseret wrote:
> 
> 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é
> 

-- 
View this message in context: http://www.nabble.com/memory-saturating-with-a-repeat-loop-tp25082952p25086324.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list