• 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: Removing Observers eats up memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Removing Observers eats up memory
      • From: Ken Thomases <email@hidden>
References: 
 >Removing Observers eats up memory (From: Markus Spoettl <email@hidden>)
 >Re: Removing Observers eats up memory (From: Ken Thomases <email@hidden>)
 >Re: Removing Observers eats up memory (From: Markus Spoettl <email@hidden>)
 >Re: Removing Observers eats up memory (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Dodgy Code - Low Level Memory Management Question!
  • Next by Date: Re: Removing Observers eats up memory
  • Previous by thread: Re: Removing Observers eats up memory
  • Next by thread: Re: Removing Observers eats up memory
  • Index(es):
    • Date
    • Thread