Re: large documents with doc based app
Re: large documents with doc based app
- Subject: Re: large documents with doc based app
- From: Alastair Houghton <email@hidden>
- Date: Thu, 6 Mar 2008 14:39:19 +0000
On 6 Mar 2008, at 00:13, Kyle Sluder wrote:
On Wed, Mar 5, 2008 at 6:40 PM, Torsten Curdt <email@hidden>
wrote:
I though NSData would handle the access just transparently. Otherwise
that would be good to keep in mind also for files slightly smaller
than 2GB :)
While NSData certainly has the capability to do memory-mapped IO, it
would be rather useless if that was all it can do.
Look into +[NSData dataWithContentsOfMappedFile:].
Unfortunately that doesn't really help. On 32-bit systems, the
limitation is (usually) address space, not RAM or swap. IIRC OS X
does leave more than 2GB of address space free for applications, but
it's easy to fragment it and end up in a situation where the largest
contiguous piece is too small.
If you need to load more than 2GB of data into "memory", you're going
to want to be 64-bit. If, on the other hand, you can load it in
pieces somehow, that's the way to go here. Depending on the data
you're working with, you may also find that you could approach the
problem differently, e.g. by processing it as a stream, or by entering
it into a database engine (most DB engines are already set up to cope
with more data than will fit in RAM).
Unfortunately the best solution is dependent on the application domain.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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