• 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: Is there a way to see who is retaining an object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to see who is retaining an object?


  • Subject: Re: Is there a way to see who is retaining an object?
  • From: Rick Hoge <email@hidden>
  • Date: Fri, 17 Jun 2005 09:36:37 -0400


You could try running the application in ObjectAlloc, which can keep track of object retains and releases & provide a full backtrace for each event.

Thanks for this tip - I've been running in ObjectAlloc, which is a great tool. It is quite painful to watch how badly I am leaking big objects ;(


By the way the following lines in in windowWillClose method of my NSWindowController subclass

NSLog(@"Retain count for MyVolumeController %@: %d",[[self document] displayName],[self retainCount]);
NSLog(@"Retain count for MyVolume %@: %d",[[self document] displayName],[[self document] retainCount]);
NSLog(@"Observation info for MyVolumeController: %@",[self observationInfo]);
NSLog(@"Observation info for MyVolume: %@",[[self document] observationInfo]);


Give the following output:

2005-06-17 09:33:42.288 NeuroLens[9253] Retain count for MyVolumeController pgp_sdy60-0-trio-20501-20040924-122018-34- mri.mnc: 5
2005-06-17 09:33:42.288 NeuroLens[9253] Retain count for MyVolume pgp_sdy60-0-trio-20501-20040924-122018-34-mri.mnc: 3
2005-06-17 09:33:42.291 NeuroLens[9253] Observation info for MyVolumeController: (
<NSKeyValueObservance: Observer: 0x15e25880, Key path: xspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead2d0>,
<NSKeyValueObservance: Observer: 0x15e25880, Key path: yspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaeb70>,
<NSKeyValueObservance: Observer: 0x15e25880, Key path: cursorSize, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb64a0>,
<NSKeyValueObservance: Observer: 0x15e25880, Key path: cursorColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaf7a0>,
<NSKeyValueObservance: Observer: 0x15e25880, Key path: cursorIsVisible, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb2310>,
<NSKeyValueObservance: Observer: 0x15e25880, Key path: showCursorHighlight, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb6940>,
<NSKeyValueObservance: Observer: 0x15e25880, Key path: cursorHighlightColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead8e0>,
<NSKeyValueObservance: Observer: 0x15e25880, Key path: quartzInterpolation, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eae860>,
<NSKeyValueObservance: Observer: 0x15e25880, Key path: sliceBackgroundColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaedb0>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: xspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead2d0>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: zspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb1c90>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: cursorSize, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb64a0>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: cursorColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaf7a0>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: cursorIsVisible, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb2310>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: showCursorHighlight, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb6940>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: cursorHighlightColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead8e0>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: quartzInterpolation, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eae860>,
<NSKeyValueObservance: Observer: 0x15e0fdf0, Key path: sliceBackgroundColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaedb0>,
<NSKeyValueObservance: Observer: 0x15ebeb10, Key path: plotXlabel, Include old: NO, Include new: NO, Context: 0x15ebf7c0, Property: 0x15ebef40>,
<NSKeyValueObservance: Observer: 0x15ebeb10, Key path: plotYlabel, Include old: NO, Include new: NO, Context: 0x15ebfa50, Property: 0x15ebef20>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: xspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead2d0>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: yspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaeb70>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: cursorSize, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb64a0>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: cursorColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaf7a0>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: cursorIsVisible, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb2310>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: showCursorHighlight, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb6940>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: cursorHighlightColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead8e0>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: quartzInterpolation, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eae860>,
<NSKeyValueObservance: Observer: 0x15e0e5c0, Key path: sliceBackgroundColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaedb0>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: yspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaeb70>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: zspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb1c90>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: cursorSize, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb64a0>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: cursorColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaf7a0>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: cursorIsVisible, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb2310>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: showCursorHighlight, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb6940>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: cursorHighlightColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead8e0>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: quartzInterpolation, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eae860>,
<NSKeyValueObservance: Observer: 0x15e284e0, Key path: sliceBackgroundColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaedb0>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: xspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead2d0>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: zspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb1c90>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: cursorSize, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb64a0>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: cursorColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaf7a0>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: cursorIsVisible, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb2310>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: showCursorHighlight, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb6940>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: cursorHighlightColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead8e0>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: quartzInterpolation, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eae860>,
<NSKeyValueObservance: Observer: 0x15e2a3b0, Key path: sliceBackgroundColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaedb0>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: yspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaeb70>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: zspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb1c90>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: cursorSize, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb64a0>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: cursorColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaf7a0>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: cursorIsVisible, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb2310>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: showCursorHighlight, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb6940>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: cursorHighlightColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead8e0>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: quartzInterpolation, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eae860>,
<NSKeyValueObservance: Observer: 0x15e0f3f0, Key path: sliceBackgroundColor, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaedb0>,
<NSKeyValueObservance: Observer: 0x15ebeb10, Key path: signals, Include old: NO, Include new: NO, Context: 0x15ec21b0, Property: 0x15ec15d0>,
<NSKeyValueObservance: Observer: 0x15ebeb10, Key path: plotDimension, Include old: NO, Include new: NO, Context: 0x15ec21c0, Property: 0x15eaf330>,
<NSKeyValueObservance: Observer: 0x15e0f730, Key path: time, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb3960>,
<NSKeyValueObservance: Observer: 0x15e25000, Key path: lowerWindowLevel, Include old: NO, Include new: YES, Context: 0x0, Property: 0x15e8c740>,
<NSKeyValueObservance: Observer: 0x15e25000, Key path: upperWindowLevel, Include old: NO, Include new: YES, Context: 0x0, Property: 0x15eb3c00>,
<NSKeyValueObservance: Observer: 0x15e0c9f0, Key path: colorSpace, Include old: NO, Include new: YES, Context: 0x0, Property: 0x15eae560>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: xspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead2d0>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: yspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eaeb70>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: zspace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb1c90>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: time, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb3960>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: lowerWindowLevel, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15e8c740>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: upperWindowLevel, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb3c00>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: colorSpace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eae560>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: traOversampling, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb07c0>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: sagOversampling, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eadbd0>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: corOversampling, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb4710>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: overlayController, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eac6f0>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: overlayOpacity, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb6370>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: overlayThreshold, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ead050>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: lowerRegionThreshold, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eafd70>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: upperRegionThreshold, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15eb5e90>
)
2005-06-17 09:33:42.293 NeuroLens[9253] Observation info for MyVolume: (
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: dimSteps, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec2fa0>,
<NSKeyValueObservance: Observer: 0x15ec3580, Key path: annotationInfo, Include old: YES, Include new: YES, Context: 0x15ec3580, Property: 0x15ec3520>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: annotationInfo.contentDescription, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec3480>,
<NSKeyValueObservance: Observer: 0x15ec39a0, Key path: annotationInfo, Include old: YES, Include new: YES, Context: 0x15ec39a0, Property: 0x15ec3520>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: annotationInfo.creatorVersion, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec38b0>,
<NSKeyValueObservance: Observer: 0x15ec3b50, Key path: annotationInfo, Include old: YES, Include new: YES, Context: 0x15ec3b50, Property: 0x15ec3520>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: annotationInfo.dataQuality, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec3a00>,
<NSKeyValueObservance: Observer: 0x15ec3d30, Key path: annotationInfo, Include old: YES, Include new: YES, Context: 0x15ec3d30, Property: 0x15ec3520>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: annotationInfo.comments, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec3ba0>,
<NSKeyValueObservance: Observer: 0x15ec3f40, Key path: displayInfo, Include old: YES, Include new: YES, Context: 0x15ec3f40, Property: 0x15ec3ee0>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: displayInfo.colorSpace, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec3b70>,
<NSKeyValueObservance: Observer: 0x15ec4370, Key path: demographicInfo, Include old: YES, Include new: YES, Context: 0x15ec4370, Property: 0x15ec4310>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: demographicInfo.name, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec4240>,
<NSKeyValueObservance: Observer: 0x15ec4730, Key path: demographicInfo, Include old: YES, Include new: YES, Context: 0x15ec4730, Property: 0x15ec4310>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: demographicInfo.id, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec4660>,
<NSKeyValueObservance: Observer: 0x15ec4940, Key path: demographicInfo, Include old: YES, Include new: YES, Context: 0x15ec4940, Property: 0x15ec4310>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: demographicInfo.category, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec48a0>,
<NSKeyValueObservance: Observer: 0x15ec4af0, Key path: demographicInfo, Include old: YES, Include new: YES, Context: 0x15ec4af0, Property: 0x15ec4310>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: demographicInfo.birthDate, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec4870>,
<NSKeyValueObservance: Observer: 0x15ec4c80, Key path: demographicInfo, Include old: YES, Include new: YES, Context: 0x15ec4c80, Property: 0x15ec4310>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: demographicInfo.age, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec4b30>,
<NSKeyValueObservance: Observer: 0x15ec4df0, Key path: demographicInfo, Include old: YES, Include new: YES, Context: 0x15ec4df0, Property: 0x15ec4310>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: demographicInfo.weight, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec4960>,
<NSKeyValueObservance: Observer: 0x15ec4d60, Key path: demographicInfo, Include old: YES, Include new: YES, Context: 0x15ec4d60, Property: 0x15ec4310>,
<NSKeyValueObservance: Observer: 0x15e21c50, Key path: demographicInfo.gender, Include old: NO, Include new: NO, Context: 0x0, Property: 0x15ec4ce0>
)




_______________________________________________
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


References: 
 >Is there a way to see who is retaining an object? (From: Rick Hoge <email@hidden>)
 >Re: Is there a way to see who is retaining an object? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Security Update 2005-006 and -[NSString length]
  • Next by Date: Re: Security Update 2005-006 and -[NSString length]
  • Previous by thread: Re: Is there a way to see who is retaining an object?
  • Next by thread: Re: Is there a way to see who is retaining an object?
  • Index(es):
    • Date
    • Thread