• 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: NSData dataWithContentsOfMappedFile with huge files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSData dataWithContentsOfMappedFile with huge files?
      • From: Cameron Hayne <email@hidden>
References: 
 >NSData dataWithContentsOfMappedFile with huge files? (From: Cameron Hayne <email@hidden>)

  • Prev by Date: -[NSURL path] returning nil
  • Next by Date: Re: Detecting non-responsive app
  • Previous by thread: Re: NSData dataWithContentsOfMappedFile with huge files?
  • Next by thread: Re: NSData dataWithContentsOfMappedFile with huge files?
  • Index(es):
    • Date
    • Thread