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 protected]>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 protected] > http://www.elevated-dev.com/ > (303) 722-0567 voice > > > > > _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
