• 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: Quincey Morris <email@hidden>
  • Date: Mon, 25 Jan 2016 09:34:33 -0800
  • Feedback-id: 167118m:167118agrif8a:167118suYJcD4DRz:SMTPCORP

On Jan 25, 2016, at 01:10 , Markus Spoettl <email@hidden> wrote:
>
> Has anyone any idea how the removing of observers can cause this kind of death spiral?

Genocidal refreshes aside, are you absolutely sure that you’re always removing/adding observers on an appropriate thread? There are two dangers here:

1. You may be doing things on a background thread that are supposed to be done on the main thread.

2. You may be doing things on multiple threads. In particular, doing massive quantities of retains and releases (via ARC) on multiple threads simultaneously has terrible performance characteristics, because (I think) there’s a lock involved. I would also assume that massive quantities of multi-threaded allocs and frees would be bad, because there has to be some kind of lock there too.

Without contention, these locks are likely zero-cost (more or less). With parallelism, the results can be bad.

There’s no particular reason to think that any of these things are happening in your scenario, but they might be worth looking into.

_______________________________________________

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: Markus Spoettl <email@hidden>
    • The PID of an Application?
      • From: Dave <email@hidden>
References: 
 >Removing Observers eats up memory (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: Removing Observers eats up memory
  • Next by Date: Re: DeepCopy Arrays and Dictionaries
  • Previous by thread: Re: Removing Observers eats up memory
  • Next by thread: The PID of an Application?
  • Index(es):
    • Date
    • Thread