• 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
Perplexing? These handlers add to heap on idle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Perplexing? These handlers add to heap on idle


  • Subject: Perplexing? These handlers add to heap on idle
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 17 Sep 2016 12:31:58 +1000

G’day all

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.

Regards

Santa


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:





And what, you ask, was the beginning of it all?
And it is this......
Existence that multiplied itself
For sheer delight of being
And plunged with numberless trillions of forms
So that it might
find
itself
innumerably

Sri Aurobindo



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

This email sent to email@hidden

  • Follow-Ups:
    • Re: Perplexing? These handlers add to heap on idle
      • From: Brian Christmas <email@hidden>
  • Prev by Date: Re: "Cannot save C and Objective C pointers in script"?
  • Next by Date: Re: Perplexing? These handlers add to heap on idle
  • Previous by thread: Re: "Cannot save C and Objective C pointers in script"?
  • Next by thread: Re: Perplexing? These handlers add to heap on idle
  • Index(es):
    • Date
    • Thread