Since I’ve nothing better to do, I decided to use ‘Instruments.app’ to see where the memory in my App was being used up.
Running the attached eats up about a MB per minute, just idling. I haven’t added all the variables ‘loopRunnder’ checks and sets, but this cycles every second. A rapid response is critical.
I know some of you say I should track down the memory loss, and some say I’d be wasting my time, but why is looping adding so much to the heap? And, it’s being added every second.
Perhaps those of you that advised I track the loss down might answer, please.
on runningLoopInitializer()
try
set p to 1
my fordEvent()
#
-- This routine gets Universal Time
set p to 2
set my resetSelector to false
set p to 3
if my interarchyActivator then
if ((current date) - (my ftpWatcherCaller) > 60) then
set my ftpWatcherCaller to current date
tell application "Finder"
try
set theCurrentState to read file (pathToDesktop & "ftp Downloads:AllTheftpData.dat" as text) as text
if (count of theCurrentState) > 0 then
try
if not (exists process "ftp Watcher") then tell application ":Applications:Mail Manager:ftp Watcher.app" to activate
end try
end if
end try
end tell
end if
end if
on error errmsg
tell application "System Events" to display dialog "runningLoopInitializer error " & errmsg & " p = " & p
end try
set my runningLoopBusy to false
my performSelector:"runningLoopInitializerLoop" withObject:(missing value) afterDelay:mailManagerDelay
end runningLoopInitializer
on runningLoopInitializerLoop()
if not (my runningLoopBusy) then
my runningLoop:{}
else
my performSelector:"runningLoopInitializerLoop" withObject:(missing value) afterDelay:mailManagerDelay
end if
end runningLoopInitializerLoop
on runningLoop:{}
set my runningLoopBusy to true
my fordEvent()
# LOTS of code
set my runningLoopBusy to false
my runningLoopInitializer()
end runningLoop: