Re: NSURLConnection: "Greedy Memory Eater" and Error 303
Re: NSURLConnection: "Greedy Memory Eater" and Error 303
- Subject: Re: NSURLConnection: "Greedy Memory Eater" and Error 303
- From: Don Quixote de la Mancha <email@hidden>
- Date: Fri, 09 Sep 2011 06:54:14 -0700
On Fri, Sep 9, 2011 at 4:06 AM, Andreas Grosam <email@hidden> wrote:
> I'm trying to use a NSURLConnection to download a large data file (>10 MB) from a web service to the iPhone. Currently, testing on iOS 4.2.1, on a device. The connection is established over WIFI.
>
> The problem I get with NSURLConnection is, that it internally uses a lot (really a lot) memory for its data buffers. It seems, the connection reads as much data as it can from the network and a tries to safe it in internal buffers, no matter what, apparently until the system cannot provide more memory.
I don't know how to fix NSURLConnection, but an alternative would be
to use the source to some other HTTP client. By having the source
code, you would have full control over the buffering.
For example, libcurl is available under the MIT License:
http://curl.haxx.se/libcurl/
That would probably be the easiest route.
You should file a bug with Apple at http://bugreport.apple.com/
Buffering a lot of data isn't a big deal on Mac OS X, but it's bad
news on an embedded device like the iPhone.
Don Quixote
--
Don Quixote de la Mancha
email@hidden
Custom Software Development for the iPhone and Mac OS X
http://www.dulcineatech.com/custom-software-development/
_______________________________________________
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