• 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: Tue, 26 Jan 2016 13:30:16 +0100

On 25/01/16 20:05, Markus Spoettl wrote:
By the way, you should consider implementing the observationInfo property on
your observed class.  This avoids KVO storing observation info in a side
table.  Note that the property is a void pointer, not an object pointer, and
therefore does no memory management.

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.

Unfortunately this was a fluke, implementing the property does not change the problem after all.

I have now followed your advice to use Allocations and the responsible culprit is MALLOC_SMALL which is called by "hashProbe" to get memory in 8MB chunks.

#	Address	Category	Timestamp	Live	Size	Responsible Library	Responsible Caller
44	0x7ffbfb800000	VM: MALLOC_SMALL	00:32.346.554	•	8,00 MB	Foundation	hashProbe

In this instance, the allocation frenzy went on for a while until the total size of the app was 4.96GB (up from 130MB were it started), then stopped for a minute, then dropped back to 130MB - apparently by draining a massive autorelease pool.

I then wrapped each object's series of observer removals within an autorelease pool, hoping it would not cause this to accumulate quite so much and it seems that does the trick.

For now.

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: Ken Thomases <email@hidden>)
 >Re: Removing Observers eats up memory (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: Obj-C - your thoughts on hiding data members?
  • Next by Date: Re: Dodgy Code - Low Level Memory Management Question!
  • Previous by thread: Re: Removing Observers eats up memory
  • Next by thread: Fwd: Stubborn link error - can't find a framework.
  • Index(es):
    • Date
    • Thread