• 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: Leak in NSData +dataWithContentsOfURL:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Leak in NSData +dataWithContentsOfURL:


  • Subject: Re: Leak in NSData +dataWithContentsOfURL:
  • From: Jonathan Feinberg <email@hidden>
  • Date: Sat, 16 Mar 2002 00:08:45 -0500

This is all very interesting. However, I wonder if it's right beyond a doubt. The problem is that NSURLHandle defines "caching" behavior whereby URLHandles, and the data they have fetched, get retained so that subsequent uses of the handle don't cause a refetch.

But if you (the user) are not explicitly retaining an NSURLHandle--indeed, if you are explicitly releasing or autoreleasing an NSData--then the library has no business retaining anything. Furthermore, if you fetch the same URL more than one time via dataWithContentsOfURL, you will clearly see the network being hit each time. Furtherfurthermore, if there were some cache being invoked, there would be no need to allocate still more memory each time.

If you create an object and dispose of it properly, the memory should go back to the heap.

N'est-ce pas?
--
Jonathan Feinberg email@hidden Inwood, NY, NY
http://MrFeinberg.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Leak in NSData +dataWithContentsOfURL:
      • From: email@hidden
References: 
 >Re: Leak in NSData +dataWithContentsOfURL: (From: email@hidden)

  • Prev by Date: Re: Leak in NSData +dataWithContentsOfURL:
  • Next by Date: Re: Utility window to minimize
  • Previous by thread: Re: Leak in NSData +dataWithContentsOfURL:
  • Next by thread: Re: Leak in NSData +dataWithContentsOfURL:
  • Index(es):
    • Date
    • Thread