Re: Severe ASOC runtime bug
Re: Severe ASOC runtime bug
On 21 Jan 2011, at 03:48, Dave wrote:
> 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.
I don't know that you can assume that memory will not become exhausted in your loop.
I don't know the strategy for memory scavenging in ASObjc or if or how it differs from AS.
Certainly in ObjC one can easily create problems of this sort when using managed as opposed to GC memory allocation.
However, there does seem to be an issue here.
To investigate the problem I would:
1. try running the allocation loop in another method to applicationDidFinishLaunching_ : use a delayed selector.
2. what occurs if setString_ becomes setInt_ and the integer is saved rather than the coerced string
3. define a NSMutableDictionary property and use a timer to allocate the AsObjC objects incrementally (say 1000 at a time).
4. try running the collector manually - see NSGarbageCollector
5. use Shark and Instruments
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com
_______________________________________________
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