Re: AppleScript crashes constantly
Re: AppleScript crashes constantly
- Subject: Re: AppleScript crashes constantly
- From: Wim Melis <email@hidden>
- Date: Mon, 12 Feb 2001 02:49:00 -0000
>
>Any ideas as to what might be causing this? [ crashes when doing long
>
>periods of text crunching ] Is there anything standard
>
>that is known to cause memory leaks?
Emmanuel wrote:
>
I don't intend any offense to anyone here, but many features of AppleScript
>
cause memory leaks.
>
What I would do as a first, easy, step would be: use the "Check Memory"
>
dialog of Smile. It has a "watch for leaks" checkbox.
Tried it, but couldn't detect any significant leaks in the Smile memory
checker. Also ran the post-compiler of Smile while I was at it, but it
didn't find anything suspicious.
>
As a remark intended to be relevant to your case, our experience has led us
>
to systematically do any text processing, parsing etc. in Smile instead of
>
using basic AppleScript. In short, we use Smile's text windows instead of
>
AppleScript variables.
I'm afraid that would be very difficult; virtually all of the text
crunching is in the form of small record en list manipulations. Trying to
do the whole thing from within a text window would require a complete
code rewrite, if at all reasonably possible.
Not to mention the speed: I would think it's unlikely that telling
another app to do lots of little things could come even close to having
Applescript do it itself. The creation of one webpage from the script now
takes about 3 seconds, wich is already darn slow when you're doing
hundreds of pages at a time.
And Ed Stockly wrote:
>
I you think the culprit might be the Finder running out of memory, try
>
quitting the finder at points before or after it might be hitting its
>
limit.
Alas, I removed all finder commands and ran the entire script without the
Finder being active. No improvement.
I also tried getting rid of the large global records and used a different
method of loading the script libraries. Again, no luck.
Finally, I inserted some debugging code that writes markers to a file,
enabling me to see exactly where the crash occurred. As it turns out,
there's no consistency at all. It can crash anywhere in the script -
sometimes after generating 5 pages, sometimes after 500, but it *will*
crash.
I have no idea what to try next, except learn to live with it. It almost
implies that AS simply isn't a stable language for serious calculations.
That'd be pretty pathetic...
Still hoping: any other suggestions?
Wim
-----
email (home): email@hidden
email (office): email@hidden
http://www.noorderlicht.com * Noorderlicht photofestival