• 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 Management for an Array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory Management for an Array


  • Subject: Re: Memory Management for an Array
  • From: Bing Li <email@hidden>
  • Date: Tue, 14 Jun 2011 01:36:55 +0800

Dear Scott and all,

I checked the system carefully. I noticed that I made a mistake on an object
design. Its dealloc method was not designed well. Now no memory leaks exist.
I appreciate so much for your help!

Best regards,
Bing Li


On Mon, Jun 13, 2011 at 10:36 PM, Scott Ribe <email@hidden>wrote:

> On Jun 13, 2011, at 3:37 AM, Bing Li wrote:
>
> > I think the memory management in my system is much better. I just used
> Instruments to check potential leaks. To my surprise, I was still notified
> that the following method got memory-leaking although the amount was small.
> You can get the screen shot of Instruments from the attachment. Could you
> please tell me how to fix this problem? Maybe I just ignore it?
>
> That surprises me.
>
> As Jens pointed out to you, you probably want to make sure you're measuring
> when the autorelease pool has had a chance to drain--but I would have
> thought something in the autorelease pool would not be reported as a leak.
>
> Pay attention to exactly what is leaking, and whether it leaks more on a
> second run. Some libraries will cache some commonly used data structures on
> their first run, which is not really a leak--most of the time Instruments
> will not flag these, but it's not perfect. So the typical symptom of this is
> that the first time you call something in Cocoa, your memory use goes up,
> but second and later calls it does not.
>
> Finally, once in a great while, it is possible you will find a bug in
> Cocoa. Not often, and usually when you think you have it turns out not to be
> the case after all ;-) But it is possible. Then, unless it's a leak that's
> really hurting you, which is even more unlikely, just report it. Don't try
> to compensate with extra releases, because when the bug does get fixed then
> you'll be over-releasing and crashing--and tricky things you might think of
> like checking the retain count are likely to not be reliable.
>
>
> --
> Scott Ribe
> email@hidden
> http://www.elevated-dev.com/
> (303) 722-0567 voice
>
>
>
>
>
_______________________________________________

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: 
 >Memory Management for an Array (From: Bing Li <email@hidden>)
 >Re: Memory Management for an Array (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Memory Management for an Array
  • Next by Date: Re: Memory Management for an Array
  • Previous by thread: Re: Memory Management for an Array
  • Next by thread: Parent-child Design Pattern
  • Index(es):
    • Date
    • Thread