Re: Removing Observers eats up memory
Re: Removing Observers eats up memory
- Subject: Re: Removing Observers eats up memory
- From: Markus Spoettl <email@hidden>
- Date: Mon, 25 Jan 2016 22:22:24 +0100
On 25/01/16 20:23, Ken Thomases wrote:
This is interesting. When I implement this property in the proxy object,
the problem goes away (at least I wasn't able to duplicate it so far). Turn
off the implementation, it comes back. Not really sure what this tells me,
though.
Implementing the property avoids the need to use the global hash table to
look up the observation info by the object's address. That, of course,
sidesteps the whole issue of any performance issues with the hash table
reorganizing itself. It's also just plain faster even without this specific
issue with the hash table. The only thing you stand to lose is making your
objects slightly larger. Since it sounds like these objects are basically
guaranteed to be key-value observed, though, it ends up saving memory.
Thanks for the suggestion and explanation, I would never have thought of using
this.
I wonder if there's a downside to implementing this in all my model objects
other than adding an additional pointer to their data size.
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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