• 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 Leaks in CocoaEcho Sample
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory Leaks in CocoaEcho Sample


  • Subject: Re: Memory Leaks in CocoaEcho Sample
  • From: Jens Beuckenhauer <email@hidden>
  • Date: Wed, 22 Oct 2008 22:35:03 +0200

Hello,

In general, the retain count is entirely meaningless. The retain count of any given object, especially objects that were created by or have passed through the Apple provided frameworks, may be seemingly random due to the internal implementation details of the class or of the frameworks. Caching, singletons, and any of a number of optimizations could impact the retain count.

Frankly, -retainCount should be deprecated and eliminated.

If you are trying to find a leak, then use one of the tools on the system designed for exactly that -- leaks, Object Graph in Instruments for GC, Object Alloc for non-GC, etc...

In my special case (the memory leak in the CocoaEcho sample) I used Instruments with the "leaks" instrument and it shows up several memory leaks. They seem to come from the openstream: and closestream: methods.


Is the retain in these methods right after I got the streams with - getInputStream:outputStream: or is it wrong? How can I test it to go sure?

I'm not really sure about this.

Thanks for your help
Jens
_______________________________________________

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 Leaks in CocoaEcho Sample
      • From: Bill Bumgarner <email@hidden>
References: 
 >Memory Leaks in CocoaEcho Sample (From: Jens Beuckenhauer <email@hidden>)
 >Re: Memory Leaks in CocoaEcho Sample (From: Marco Masser <email@hidden>)
 >Re: Memory Leaks in CocoaEcho Sample (From: Nick Zitzmann <email@hidden>)
 >Re: Memory Leaks in CocoaEcho Sample (From: Marco Masser <email@hidden>)
 >Re: Memory Leaks in CocoaEcho Sample (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: Increment object property
  • Next by Date: Re: another n00b question -- how to find a memory leak
  • Previous by thread: Re: Memory Leaks in CocoaEcho Sample
  • Next by thread: Re: Memory Leaks in CocoaEcho Sample
  • Index(es):
    • Date
    • Thread