New Stack crash

Jan Schenkel janschenkel at yahoo.com
Wed Jun 23 04:43:08 EDT 2010


You're probably running out of memory - delete stack may not release everything right away.
My first step would be setting the templateStack properties 'destroyStack' and 'destroyWindow' to true - that way the resources claimed by the stack and its window are released upon close. By default these are false.
The second step would be to give the engine's memory manager / garbage collector a chance to get rid of the obsolete allocated memory. You could try inserting 'wait 0 milliseconds' after the delete; or convert your loop to a 'send in time' construct with a short delay.

HTH,

Jan Schenkel
=====
Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


--- On Tue, 6/22/10, Dan Friedman <dan at clearvisiontech.com> wrote:
> Greetings!
> 
> I have the following script in a button:
> 
> on mouseUp
>   put 0 into i
>   repeat 30000
>     add 1 to i
>     put ("testStack_" & i) into sName
>     new stack sName
>     delete stack sName
>   end repeat
> end mouseUp
> 
> Two questions:
> 
> (1) Why would this start to slow down?  It starts off
> quite fast, then it beings to slow down.  It gets so
> that it takes 5, or 6 seconds to complete one repeat. 
> This happens in both in REV and as a standalone.  Is
> this because of the "add 1 to i"?  Is this no better
> than "repeat with i = ...", which is known to be slow?
> 
> (2) Rev will eventually crash.  In my testing, it
> seems random and crashes sometime after about 1700. 
> Shouldn't the "delete stack" call completely remove the
> stack?  So, why crash?
> 
> Any thoughts?
>


      




More information about the Use-livecode mailing list