Re: Questions about uploading files via background NSURLSession
Re: Questions about uploading files via background NSURLSession
- Subject: Re: Questions about uploading files via background NSURLSession
- From: Rick Mann <email@hidden>
- Date: Tue, 03 Feb 2015 14:37:46 -0800
> On Feb 3, 2015, at 14:33 , Jens Alfke <email@hidden> wrote:
>
>
>> On Feb 3, 2015, at 11:38 AM, Rick Mann <email@hidden> wrote:
>>
>> It only sends one file at a time, partly because it loads the contents into RAM to do the upload
>
> FYI: If you memory-map the file contents there's a lot less overhead to this. Assuming you're using NSData, use both the NSDataReadingMappedIfSafe and NSDataReadingUncached flags. The result will be roughly equivalent to reading the file directly off disk without storing it in RAM.
>
> (You still have to worry about running out of address space, though, so in a 32-bit process you probably shouldn't open more than maybe a gigabyte of files this way. In 64-bit you're only limited by the max number of open file descriptors, which I think defaults to 256.)
Well, I want to take advantage of background downloads, I just want to make sure that won't cause other problems.
--
Rick Mann
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden