I'm playing with injection of F-Script inside an application.
I was able to automate my process (a long loop that open a new file
each time) with a small F-script code, like this :
1 to:100000 do:[
launchMethodOfTheApplicationThatINeed. (take some important memory at
each call)
]
But, as the memory isn't freeing, my memory swap very quickly. So I
tried to add :
localPool := NSAutoreleasePool new.
launchMethodOfTheApplicationThatINeed. (take some important memory at
each call)
localPool drain.
but the alloc of NSAutoreleasePool give me the error :
NSInvalidArgumentException: *** -[NSAutoreleasePool retain]: Cannot
retain an autorelease pool
Any ideas on how to solve this Issue?
Thanks.
-- Laurent
ps: Apologize for my English :-(
poolHolder := NSValue valueWithNonretainedObject:NSAutoreleasePool
new.
launchMethodOfTheApplicationThatINeed. (take some important memory at
each call)
poolHolder nonretainedObjectValue drain.
On Feb 10, 3:12 am, Philippe Mougin <pmou...@acm.org> wrote:
> One solution is
> to manage your pool through an NSValue configured to not retain its
> value. This gives:
Perfect , "valueWithNonretainedObject" was exactly what I was looking
for.
Thanks a lot Philippe.