• 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: Severe ASOC runtime bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Severe ASOC runtime bug


  • Subject: Re: Severe ASOC runtime bug
  • From: Dave <email@hidden>
  • Date: Thu, 20 Jan 2011 21:48:36 -0600

I've been trying dozens of variations to get past the infinite memory bug using NSMutableDictionary. I've now found an even simpler test case which fails and it doesn't use any Cocoa objects. It allocates either 500 or 10,000 objects in one of two modes. For 'true' it doesn't assign a string to each instance property and for 'false' it does.

The 'false' case of trying to allocate 10,000 instances shows ASOC has a severe bug which makes it try to allocate infinite memory.  This test code does not save any of the objects, so it should never run out of memory.

-- dave


-- Dave
property DataItemClass : class "DataItem"

script MemoryLimitBug4AppDelegate
property parent : class "NSObject"


on applicationDidFinishLaunching_(aNotification)
try
-- TRUE - Runs to completion in .1 seconds, app taking 18MB of real memory
-- FALSE - Runs to completion in .5 seconds, app taking 18MB of real memory
set limit to 500


-- TRUE - Runs to completion in 3 seconds, app taking 19MB of real memory
-- FALSE - Quickly goes up to 1.1GB real memory and keeps trying for more, must kill to terminate
-- set limit to 10000


if true then
log "creating " & limit & " objects without setting string"
repeat with i from 1 to limit
set anotherObj to DataItemClass's alloc()'s init()
end repeat
else
log "creating " & limit & " objects setting string"
repeat with i from 1 to limit
set anotherObj to DataItemClass's alloc()'s init()
anotherObj's setString_(i as string)
end repeat
end if


log "DONE"
on error errMsg number errorNumber
log "on error: " & errMsg & ": " & errorNumber
end try
end applicationDidFinishLaunching_


on applicationShouldTerminate_(sender)
return current application's NSTerminateNow
end applicationShouldTerminate_


end script


script DataItem
property parent : class "NSObject"


property aString : missing value


on setString_(theString)
set my aString to theString as string
end setString_


end script
____________________________________


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Severe ASOC runtime bug
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: Severe ASOC runtime bug
  • Next by Date: Re: Severe ASOC runtime bug
  • Previous by thread: Re: Severe ASOC runtime bug
  • Next by thread: Re: Severe ASOC runtime bug
  • Index(es):
    • Date
    • Thread