Re: what is the best way to 'unset' a variable
Re: what is the best way to 'unset' a variable
- Subject: Re: what is the best way to 'unset' a variable
- From: John W Baxter <email@hidden>
- Date: Sat, 23 Mar 2002 16:44:00 -0800
At 15:30 -0800 3/23/2002, John W Baxter wrote:
>
5. OK, so why does one one-meg string use 3 meg of memory?
>
I think it goes like this: for at least an instant, three copies of
>
the string exist.
>
a. the copy made in the buildString handler
>
b. the copy the handler returned
>
c. the copy in the variable
>
The first two of these get garbage collected quickly, but not "quickly
>
enough". AppleScript does not give memory back to the memory manager once
>
it has asked for the memory...it manages the memory itself. So to the
>
About this Computer application, the memory usage is what it was at the
>
instant the three copies existed.
Hmmm...
Alternate explanation: Building the string in the way the handler does
leaves behind a whole bunch of building blocks which haven't yet been
garbage collected when a and c happen; and b isn't there.
I don't know how to tell the difference from "outside".
--John
--
John Baxter email@hidden Port Ludlow, WA, USA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.