• 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:24:29 +0100

On 25/01/16 18:34, Quincey Morris wrote:
On Jan 25, 2016, at 01:10 , Markus Spoettl <email@hidden
<mailto: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.

Yes, true, worth a shot. Unfortunately not the problem, it all happens on the main thread. The code also doesn't use ARC (though the standard libs might, I don't know).

Ken's suggestion implementing observationInfo solves this issue for me.

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


References: 
 >Removing Observers eats up memory (From: Markus Spoettl <email@hidden>)
 >Re: Removing Observers eats up memory (From: Quincey Morris <email@hidden>)

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