Memory Problems

Ray Horsley ray at linkitonline.com
Fri Feb 21 13:37:01 EST 2003


Once again, I owe a great big thanks to those on the list who helped me with
this thing.  As it turned out, the idle handler was the solution.  However,
it seems to me I remember some discusion on the list a while back about
problems with idle handlers under certain circumstances.  If anyone
remembers what those problems were or where I can look them up, please let
me know.

Thanks,


Ray Horsley
Developer, LinkIt! Software




on 2/21/03 12:25 AM, Pierre Sahores at psahores at easynet.fr wrote:

> Dave Cragg wrote:
>> 
>> At 12:14 pm -0800 20/2/03, Ray Horsley wrote:
>>> Thank you xbury and Pierre,
>>> 
>>> I appreciate the suggestions, however, I've opened all 36 stacks I'm using
>>> for testing, set the Destroy Stack on Close and the Destroy Window on Close
>>> to true, and I also set the Always Buffer to false for all of them.  Sorry,
>>> no change.  I still find Metacard increasing in memory from about 17 megs to
>>> a little over 30 if I go to or refer to each of them.  Any other ideas?
>>> 
>>> Thanks,
>>> 
>> 
>> I  remember having a similar problem a few versions ago. I found that
>> the stacks weren't cleared from memory until the current handler
>> stopped running. So in a repeat loop like yours, memory won't get
>> cleared until after the loop finishes.
>> 
>> Things to try:
>> 
>> Add a wait after you have handled a certain number of stacks. For
>> example, you could try adding the following line at the end of your
>> repeat loop to wait after every 5th stack:
>> 
>> repeat with L=1 to number of lines of allStacks  -- list of 30 stack paths
>> ##other stuff here
>> delete stack stackPath
>> if L mod 5 = 0 then wait 100 milliseconds  ##add this
>> end repeat
>> 
>> If that doesn't work, try using "send ... in <time>". Something like:
>> 
>> repeat with L=1 to number of lines of allStacks  -- list of 30 stack paths
>> put line L of allStacks into stackPath
>> send "doStuff stackpath" to me in 20 milliseconds
>> end repeat
>> 
>> on doStuff stackpath
>> set the defaultStack to stackPath     -- or go stack stack path
>> -- do some stuff like set scripts and save the stack
>> delete stack stackPath
>> end doStuff
>> 
>> Cheers
>> Dave
>> _______________________________________________
>> metacard mailing list
>> metacard at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/metacard
> 
> In the same way described by Dave, tou could, perhaps, get good results
> in using a recursive command included in an "on idle" handler instead of
> using your statements inside a repeat loop and in storing allstacks an
> the lines to parse in allstacks in two global vars.




More information about the metacard mailing list