• 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: Memory not being released in a timely manner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory not being released in a timely manner


  • Subject: Re: Memory not being released in a timely manner
  • From: Jonathan Taylor <email@hidden>
  • Date: Fri, 07 Jun 2013 12:05:30 +0100

> The Allocations instrument should report objects with pending autoreleases as ordinary live objects. (Note that many objects with retain count == pending autorelease count will be retained again before the autorelease pool pops.)
>
> In OS X 10.8 and iOS 6 simulator, you can set environment variable OBJC_PRINT_POOL_HIGHWATER=YES to get debugging logs of the autorelease pool high-water mark on each thread. This can detect code that accumulates lots of autorelease garbage without spinning any pools. (The high-water mark is not checked until the pool is popped, so you'd have to actually finish the work to see the result.)

Thanks for your comments Greg, very interesting. Unfortunately (in a sense!) the problem doesn't seem to happen on 10.8, so I can't reproduce the problem and get those debug logs.

> "The Allocations instrument should report objects with pending autoreleases as ordinary live objects"

Do you happen to know if that's true of Allocations on 10.6? Is that definitely true for objects that have actually passed out of scope, and it would therefore be forbidden to re-retain them (if you know what I mean), but which haven't actually been freed "behind the scenes"?

I'm not seeing Allocations report large amounts of memory. I assume that it should be reporting anything that is present within my 32-bit address space (i.e. I assume there isn't any way that external libraries could allocate memory that is in some way hidden from Allocations)? If that is the case, I suppose the only other possibility I can think of is that I am fragmenting the address space to such an extent that there is no way of allocating any further buffers (size of order 1MB).

Currently my understanding of the problem is pretty much limited to:
- Allocations claims only 300MB allocated memory
- 1.2MB buffer cannot be allocated ("insufficient memory")
- Occurs when program is in background, and "tickling" autorelease pools at 1 second intervals makes the problem go away.
- Occurs on 10.6, not on 10.8

I do have a solution in the form of the "tickling", but I'd be very interested if you had any suggestions on ways I could dig further into the underlying cause.

Cheers
Jonny
_______________________________________________

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: Memory not being released in a timely manner
      • From: Fritz Anderson <email@hidden>
References: 
 >Memory not being released in a timely manner (From: Jonathan Taylor <email@hidden>)
 >Re: Memory not being released in a timely manner (From: Jeff Johnson <email@hidden>)
 >Re: Memory not being released in a timely manner (From: Jens Alfke <email@hidden>)
 >Re: Memory not being released in a timely manner (From: Jonathan Taylor <email@hidden>)
 >Re: Memory not being released in a timely manner (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: Layout on Mini is broken
  • Next by Date: Move cursor to previous/next line in UITextView
  • Previous by thread: Re: Memory not being released in a timely manner
  • Next by thread: Re: Memory not being released in a timely manner
  • Index(es):
    • Date
    • Thread