Re: NSData dataWithContentsOfMappedFile with huge files?
Re: NSData dataWithContentsOfMappedFile with huge files?
- Subject: Re: NSData dataWithContentsOfMappedFile with huge files?
- From: "Shawn Erickson" <email@hidden>
- Date: Fri, 25 Aug 2006 13:54:29 -0700
On 8/25/06, Cameron Hayne <email@hidden> wrote:
I tried to use the NSData dataWithContentsOfMappedFile method to get
the data from a huge (80 GB) file - but it failed (returned nil).
I suspect that the problem is the size of the file since the same
code works for smaller files.
Does anyone know what the size limit is for the use of
'dataWithContentsOfMappedFile' ?
If NSData does a straight contiguous mapping (which it likely has to
do given its API) the limit is just a little over 2 GiB in size
(assuming a clean application heap). The near 2 GiB comes from the
largest contiguous range of virtual addresses that is available in 32
bit applications on Mac OS X (you applications 4 GiB virtual memory
space is broken up by reserved ranges and shared library mappings
leaving you with just over 3 GiB of available pages with just over 2
GiB being contiguous).
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden