Re: I'm losing my memory (GC & NSImageView)
Re: I'm losing my memory (GC & NSImageView)
- Subject: Re: I'm losing my memory (GC & NSImageView)
- From: Erik Buck <email@hidden>
- Date: Sun, 4 Nov 2007 07:51:43 -0800 (PST)
You haven't given us enough information to know for
sure what the problem is.
You obviously suspect that the garbage collector is
not running often enough, and you may be correct. One
of the most famous drawbacks to automatic garbage
collection is the problem of knowing when it should
run. In this case, I suspect grabage collection only
runs if control returns to the event loop. Sliders
and other controls do not return to the event loop
until mouse up.
Try calling your slider's action with
performSelector:afterDelay: so that the event loop and
the garbage collector run.
In my case, one application produces real time
animation, and a pause to garbage collect at the wrong
time is disastrous. On the flip side, if garbage is
not collected often enough, memory use grows
uncontrollably and eventually the system pauses
because of swapping.
The problem for me is always the "pause". With manual
memory management, the best/correct trade-off can be
implemented in each case.
It is good that Apple has provided an opt-in garbage
collector. Many types of application are well suited
to automatic garbage collection and are not affected
by pauses. Other applications can't tollerate it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden