Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Out of memory??



On Apr 5, 2006, at 4:58 PM, Stockly, Ed wrote:

The script has been running just fine for weeks, but has developed a problem. On the user's mac it's generating an "out of memory" error. ... Has anyone else encountered an "out of memory" error? it's the "out of memory" error that's got me puzzled. I haven't seen this error in Mac OS 10, and thought they were a thing of the past.

Well, yes and no. On the one hand, it's possible to allocate a lot more memory than you could in the Classic days. (It is still possible to run out, but it takes a lot of work or the right kind of mistake.) However, that doesn't mean that a component can't hit some sort of internal limit and report it as "out of memory", which is probably what's happening here.


There are two likely culprits. One is the decompiler: it generates everything as styled text, and because styled text is limited to 32,767 style runs, if there are more style runs than that, it will throw an "out of memory" error. (This isn't particularly correct, but there you are.) "as string" and "as Unicode text" operations will also invoke the same mechanism, so a sufficiently large value could cause the same problem. The workaround is to set your all your source styles to the same thing.

The other possibility (rather less likely, but plausible) is that you're running out of garbage-collected heap memory, which is where your script and all its "live" data while it's executing goes. "Running out", in this case, is an artificial construct -- there's a fixed maximum that you're not allowed to exceed. By default, this is 32MB; you can change it by adding an 'scsz' resource to the application running the script. (Instructions available on request.)

Both of these are considered bugs, and we plan to relax them, if not completely remove them, in a future release.


--Chris Nebel AppleScript and Automator Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Out of memory?? (From: "Stockly, Ed" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.