On Fri, Sep 9, 2011 at 4:06 AM, Andreas Grosam <[email protected]> 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 protected]

   Custom Software Development for the iPhone and Mac OS X
   http://www.dulcineatech.com/custom-software-development/
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to