Re: MemoryMapping Large Files - ???
Re: MemoryMapping Large Files - ???
- Subject: Re: MemoryMapping Large Files - ???
- From: David Rehring <email@hidden>
- Date: Sat, 12 Jan 2002 11:56:10 -0800
On 1/12/02 3:52 AM, Christopher Holland at email@hidden wrote:
>
Of course the length of the file is almost 2 gigs so I realized that it
>
might
>
have problems before I got started. OSX is supposed to be able to handle
>
files larger than 2 gigs, correct?
>
>
I'm using the following code:
>
bigData = [[NSData alloc] initWithContentsOfMappedFile:bigDataPath];
>
>
I've tried using 'initWithContentsOfFile' also...just to see if it was the
>
memory mapping doing it.....no go there.
>
>
Should I use the BSD 'mmap' funtion instead of using the 'NSData' methods
>
above? I'm not coding wizard, but I 've worked with this data and written a
>
similar program for SGIs. I'm just starting to work on OSX programming and
>
I'm excited by the possibilities.
>
>
Any insight into the mmap problem would be appreciated.
One thing I would check would be to see if you have 2 Gb of continuous space
free in your memory map. It could be that between where the various
frameworks are mapped and memory you have already allocated, there might not
be anywhere for this file to be mapped...maybe see if there is a way to map
only part of the file at a time.
Later,
--
David Rehring Psychos do not explode when light hits
Senior Software Engineer them, no matter how crazy they are...
Atimi Software, Inc.
www.atimi.com And totally insane guy!