• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: what is the best way to 'unset' a variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: what is the best way to 'unset' a variable (From: Bill Hoffman <email@hidden>)
 >Re: what is the best way to 'unset' a variable (From: John W Baxter <email@hidden>)

  • Prev by Date: Re: Finding folder from its id
  • Next by Date: Re: [OS X]getting email addresses with AppleScript
  • Previous by thread: Re: what is the best way to 'unset' a variable
  • Next by thread: Re: what is the best way to 'unset' a variable
  • Index(es):
    • Date
    • Thread