Re: Learning MallocDebug/Leaks
Re: Learning MallocDebug/Leaks
- Subject: Re: Learning MallocDebug/Leaks
- From: Chris Outwin <email@hidden>
- Date: Sat, 18 Mar 2006 10:07:51 -0600
Thank you for your kind help. I will download your Leaks beta
version and use it to learn more. Something I've always though would
be helpful would be to have examples of code that purposely leaked
with a description of how that leak would be presented in the leak
tool. If your new leak tool included some documentation like this,
I think many people would appreciate it.
On Mar 18, 2006, at 4:07 AM, j o a r wrote:
On 18 mar 2006, at 04.48, Chris Outwin wrote:
I have tried hard to learn MallocDebug and Leaks, but could use
some advice.
Here are 4 examples of why I'm confused after reading the
attending docs of for these tools:
1. Leaks reports 3 leaks for 224 total leaked bytes for a
completely new Cocoa app and yet reports no leaks for Apple's
Sketch example app
2. MallocDebug reports a leak in my app, but doesn't list any of
my methods. I don't know where to start looking for the leak
3. MallocDebug's hex dump lists what to me are random characters
4. MallocDebug and Leaks reports different information for the
same app even when the -exclude option is used with Leaks
Have I missed some leak examples or a book which would help me to
learn? Thank you.
MallocDebug and leaks uses different underlying implementations for
locating leaks, so it's not unexpected that they can report a
different number of leaks. The documentation states that:
"The leaks tool has some advantages over MallocDebug when it comes
to detecting leaks in complex data structures. For example, the
leaks tool correctly handles leaks in circularly linked structures.
It can also identify leaks in groups of connected nodes.
MallocDebug may not correctly identify leaks in these types of
structures."
<http://developer.apple.com/documentation/Performance/Conceptual/
ManagingMemory/Articles/FindingLeaks.html>
Let me also take this opportunity to make a sneak announcement for
a new application of mine that's currently available in beta:
<http://www.joar.com/leaks/>
This app will help you visualize the reports generated by the leaks
command line utility. It also contains some documentation and
discussion on how to use leaks that might be of interest to you.
My app is a 1.0 version, and lacks a lot of obvious features, but
it can still be very useful for browsing your leaks reports. Any
feedback would be greatly appreciated!
j o a r
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden