• 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
alias and memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

alias and memory leak


  • Subject: alias and memory leak
  • From: Victor Yee <email@hidden>
  • Date: Sat, 17 Feb 2001 13:46:33 -0500

I asked before if resolving aliases could lead to a memory leak. With a little testing, I've refined the question to: does failing to resolve an alias lead to a memory leak? Well... it does on my computer :-(

Here are my two test scripts saved as stay-open applets. I'm using Peek-a-Boo to watch free memory. Be sure to quit the first applet before it hits zero, otherwise, it may fail to respond and require a force-quit:

property x : "nullDisk:nullFile" -- this path intentionally does not exist
on idle
leakMe()
return 2
end idle
on leakMe()
repeat 20 times
nameAvailable(x)
end repeat
end leakMe
on nameAvailable(thisPathStr)
try
alias thisPathStr
return false
on error
return true
end try
end nameAvailable


property x : "nullDisk:nullFile"
on idle
leakMe()
return 2
end idle
on leakMe()
repeat 20 times
nameAvailable(x)
end repeat
end leakMe
on nameAvailable(thisPathStr)
tell application "Finder" to return not (exists item thisPathStr)
end nameAvailable

--
Victor


  • Follow-Ups:
    • Re: alias and memory leak
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Admin: a suggestion on the script corruption problem.
  • Next by Date: Re: applescript-users digest, Vol 2 #387 - 15 msgs
  • Previous by thread: Re: applescript-users digest, Vol 2 #386 - 11 msgs
  • Next by thread: Re: alias and memory leak
  • Index(es):
    • Date
    • Thread